forked from bmpinto/todo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AppInfo.php
49 lines (42 loc) · 1.27 KB
/
AppInfo.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/**
* This class provides static methods that return pieces of data specific to
* your app
*/
class AppInfo {
/*****************************************************************************
*
* These functions provide the unique identifiers that your app users. These
* have been pre-populated for you, but you may need to change them at some
* point. They are currently being stored in 'Environment Variables'. To
* learn more about these, visit
* 'http://php.net/manual/en/function.getenv.php'
*
****************************************************************************/
/**
* @return the appID for this app
*/
public static function appID() {
return getenv('FACEBOOK_APP_ID');
}
/**
* @return the appSecret for this app
*/
public static function appSecret() {
return getenv('FACEBOOK_SECRET');
}
/**
* @return the url
*/
public static function getUrl($path = '/') {
if (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1)
|| isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'
) {
$protocol = 'https://';
}
else {
$protocol = 'http://';
}
return $protocol . $_SERVER['HTTP_HOST'] . $path;
}
}