Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 3abf8cc919
Fetching contributors…

Cannot retrieve contributors at this time

50 lines (42 sloc) 1.3 kb
<?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;
}
}
Jump to Line
Something went wrong with that request. Please try again.