Skip to content
Newer
Older
100644 50 lines (42 sloc) 1.27 KB
8510ae9 @mortenbagai new sample app
mortenbagai authored
1 <?php
2
3 /**
4 * This class provides static methods that return pieces of data specific to
5 * your app
6 */
7 class AppInfo {
8
9 /*****************************************************************************
10 *
11 * These functions provide the unique identifiers that your app users. These
12 * have been pre-populated for you, but you may need to change them at some
13 * point. They are currently being stored in 'Environment Variables'. To
14 * learn more about these, visit
15 * 'http://php.net/manual/en/function.getenv.php'
16 *
17 ****************************************************************************/
18
19 /**
20 * @return the appID for this app
21 */
22 public static function appID() {
23 return getenv('FACEBOOK_APP_ID');
24 }
25
26 /**
27 * @return the appSecret for this app
28 */
29 public static function appSecret() {
30 return getenv('FACEBOOK_SECRET');
31 }
32a4e37 @WizKid A total rewrite of the app.
WizKid authored
32
8510ae9 @mortenbagai new sample app
mortenbagai authored
33 /**
32a4e37 @WizKid A total rewrite of the app.
WizKid authored
34 * @return the url
8510ae9 @mortenbagai new sample app
mortenbagai authored
35 */
32a4e37 @WizKid A total rewrite of the app.
WizKid authored
36 public static function getUrl($path = '/') {
37 if (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1)
38 || isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'
39 ) {
40 $protocol = 'https://';
41 }
42 else {
43 $protocol = 'http://';
44 }
45
46 return $protocol . $_SERVER['HTTP_HOST'] . $path;
8510ae9 @mortenbagai new sample app
mortenbagai authored
47 }
48
49 }
Something went wrong with that request. Please try again.