Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 5b0f7da200
Fetching contributors…

Cannot retrieve contributors at this time

file 49 lines (42 sloc) 1.3 kb
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;
  }

}
Something went wrong with that request. Please try again.