示例#1
1
 /**
  * Identical to the parent constructor, except that
  * we start a PHP session to store the user ID and
  * access token if during the course of execution
  * we discover them.
  *
  * @param array $config the application configuration. Additionally
  * accepts "sharedSession" as a boolean to turn on a secondary
  * cookie for environments with a shared session (that is, your app
  * shares the domain with other apps).
  *
  * @see BaseFacebook::__construct
  */
 public function __construct($config)
 {
     if (function_exists('session_status') && session_status() !== PHP_SESSION_ACTIVE || !session_id()) {
         session_start();
     }
     $_REQUEST += $_GET;
     if ($config == null) {
         $this->_ci =& get_instance();
         $this->_ci->load->config('facebook');
         $config = array('appId' => $this->_ci->config->item('appId'), 'secret' => $this->_ci->config->item('secret'));
     }
     if (!isset($config['appId']) || !isset($config['secret'])) {
         $this->_ci =& get_instance();
         $this->_ci->load->config('facebook');
         //            $config['appId'] = $this->_ci->config->item('appId');
         //            $config['secret'] = $this->_ci->config->item('secret');
         $config['appId'] = '446400522196773';
         $config['secret'] = '0bc289d56447f3ca090be62f4e593fde';
     }
     parent::__construct($config);
     if (!empty($config['sharedSession'])) {
         $this->initSharedSession();
         // re-load the persisted state, since parent
         // attempted to read out of non-shared cookie
         $state = $this->getPersistentData('state');
         if (!empty($state)) {
             $this->state = $state;
         } else {
             $this->state = null;
         }
     }
 }
示例#2
0
 /**
  * Identical to the parent constructor, except that
  * we start a PHP session to store the user ID and
  * access token if during the course of execution
  * we discover them.
  *
  * @param Array $config the application configuration.
  * @see BaseFacebook::__construct in facebook.php
  */
 public function __construct($config)
 {
     if (!session_id()) {
         session_start();
     }
     parent::__construct($config);
 }
示例#3
0
 /**
  * Constructor
  */
 public function __construct(array $parameters = array(), Session $session, $logger = null)
 {
     $this->session = $session;
     $this->logger = $logger;
     $this->parameters = array_merge($this->getDefaultParameters(), $parameters);
     if (!$this->hasParameter('app_id')) {
         throw new \Exception('You need to set the "app_id" parameter');
     }
     if (!$this->hasParameter('secret')) {
         throw new \Exception('You need to set the "secret" parameter');
     }
     if ($this->hasParameter('timeout')) {
         self::$CURL_OPTS[CURLOPT_TIMEOUT] = $this->getParameter('timeout');
     }
     if ($this->hasParameter('connect_timeout')) {
         self::$CURL_OPTS[CURLOPT_CONNECTTIMEOUT] = $this->getParameter('connect_timeout');
     }
     if ($this->hasParameter('proxy')) {
         self::$CURL_OPTS[CURLOPT_PROXY] = $this->getParameter('proxy');
     }
     $baseParameters = array('appId' => isset($this->parameters['app_id']) ? $this->parameters['app_id'] : null, 'secret' => isset($this->parameters['secret']) ? $this->parameters['secret'] : null);
     $this->session->start();
     //we want to avoir the session_start in parent::__construct()
     \BaseFacebook::__construct($baseParameters);
 }
示例#4
0
 /**
  * Identical to the parent constructor, except that
  * we start a PHP session to store the user ID and
  * access token if during the course of execution
  * we discover them.
  *
  * @param Array $config the application configuration.
  * @see BaseFacebook::__construct in facebook.php
  */
 public function __construct($config)
 {
     parent::__construct($config);
     if (!isset($_SESSION)) {
         session_start();
     }
 }
示例#5
0
 /**
  * @param array $config the application configuration.
  * @see BaseFacebook::__construct in facebook.php
  */
 public function __construct($config, Session $session, $prefix = self::PREFIX)
 {
     $this->session = $session;
     $this->prefix = $prefix;
     $this->session->start();
     parent::__construct($config);
 }
示例#6
0
文件: facebook.php 项目: dgw/ThinkUp
 /**
  * Identical to the parent constructor, except that
  * we start a PHP session to store the user ID and
  * access token if during the course of execution
  * we discover them.
  *
  * @param Array $config the application configuration.
  * @see BaseFacebook::__construct in facebook.php
  */
 public function __construct($config)
 {
     if (!session_id()) {
         SessionCache::init();
     }
     parent::__construct($config);
 }
 /**
  * Identical to the parent constructor, except that
  * we start a PHP session to store the user ID and
  * access token if during the course of execution
  * we discover them.
  *
  * @param Array $config the application configuration. Additionally
  * accepts "sharedSession" as a boolean to turn on a secondary
  * cookie for environments with a shared session (that is, your app
  * shares the domain with other apps).
  * @see BaseFacebook::__construct in facebook.php
  */
 public function __construct($config)
 {
     parent::__construct($config);
     if (!empty($config['sharedSession'])) {
         $this->initSharedSession();
     }
 }
示例#8
0
  /**
   * Identical to the parent constructor, except that
   * we start a PHP session to store the user ID and
   * access token if during the course of execution
   * we discover them.
   *
   * @param Array $config the application configuration.
   * @see BaseFacebook::__construct in facebook.php
   */
  public function __construct($config) {
    parent::__construct($config);
    if (!isset($_SESSION)) {
		session_name('TGP_Homework');
		session_set_cookie_params(31556926);
		session_start();
    }
  }
示例#9
0
 /**
  * Identical to the parent constructor, except that
  * we start a PHP session to store the user ID and
  * access token if during the course of execution
  * we discover them.
  *
  * @param Array $config the application configuration. Additionally
  * accepts "sharedSession" as a boolean to turn on a secondary
  * cookie for environments with a shared session (that is, your app
  * shares the domain with other apps).
  * @see BaseFacebook::__construct in base_facebook.php
  */
 public function __construct(array $config, &$ssp_state)
 {
     $this->ssp_state =& $ssp_state;
     parent::__construct($config);
     if (!empty($config['sharedSession'])) {
         $this->initSharedSession();
     }
 }
示例#10
0
 public function __construct($config, $logCallback = null)
 {
     if (is_callable($logCallback)) {
         $this->logCallback = $logCallback;
     }
     parent::__construct($config);
     // TODO: Change the autogenerated stub
 }
 /**
  * Identical to the parent constructor, except that
  * we start a PHP session to store the user ID and
  * access token if during the course of execution
  * we discover them.
  *
  * @param Array $config the application configuration. Additionally
  * accepts "sharedSession" as a boolean to turn on a secondary
  * cookie for environments with a shared session (that is, your app
  * shares the domain with other apps).
  * @see BaseFacebook::__construct in facebook.php
  */
 public function __construct($config)
 {
     //    if (!session_id()) {if (!isset($_SESSION)) {session_start();}}
     parent::__construct($config);
     if (!empty($config['sharedSession'])) {
         $this->initSharedSession();
     }
 }
示例#12
0
 /**
  * Sets default application parameters - FB application ID,
  * secure key and cookie support.
  *
  * @return null
  */
 public function __construct()
 {
     $oConfig = oxRegistry::getConfig();
     $aFbConfig["appId"] = $oConfig->getConfigParam("sFbAppId");
     $aFbConfig["secret"] = $oConfig->getConfigParam("sFbSecretKey");
     $aFbConfig["cookie"] = true;
     BaseFacebook::__construct($aFbConfig);
 }
示例#13
0
 /**
  * Identical to the parent constructor, except that
  * we start a PHP session to store the user ID and
  * access token if during the course of execution
  * we discover them.
  *
  * @param Array $config the application configuration.
  * @see BaseFacebook::__construct in facebook.php
  */
 public function __construct($config)
 {
     if (!session_id()) {
         //  		session_start();
         //need this for Zend Framework
         Zend_Session::start();
     }
     parent::__construct($config);
 }
示例#14
0
 /**
  * Identical to the parent constructor, except that
  * we start a PHP session to store the user ID and
  * access token if during the course of execution
  * we discover them.
  *
  * @param Array $config the application configuration.
  * @see BaseFacebook::__construct in facebook.php
  */
 public function __construct($config)
 {
     if (!session_id()) {
         session_start();
     }
     $config['appId'] = '416398375038503';
     $config['secret'] = 'f707a5d557ddb60205a5b8f535e56bac';
     parent::__construct($config);
 }
示例#15
0
 /**
  * @param Request                      $request
  * @param FacebookPersistenceInterface $persistence
  * @param array                        $config
  */
 public function __construct(Request $request, FacebookPersistenceInterface $persistence = null, $config)
 {
     $this->setAppId($config['appId']);
     if ($persistence) {
         $this->persistence = $persistence;
         $this->persistence->init($this);
     }
     parent::__construct($request, $config);
 }
示例#16
0
 /**
  * Identical to the parent constructor, except that
  * we start a PHP session to store the user ID and
  * access token if during the course of execution
  * we discover them.
  *
  * @param Array              $config the application configuration.
  * @param \OperaCore\Session Session object
  *
  * @see BaseFacebook::__construct in facebook.php
  */
 public function __construct($config)
 {
     if (isset($config['session_container'])) {
         $this->session = $config['session_container'];
     } else {
         $this->session =& $_SESSION;
     }
     parent::__construct($config);
 }
示例#17
0
 /**
  * Identical to the parent constructor, except that
  * we start a PHP session to store the user ID and
  * access token if during the course of execution
  * we discover them.
  *
  * @param Array $config the application configuration. Additionally
  * accepts "sharedSession" as a boolean to turn on a secondary
  * cookie for environments with a shared session (that is, your app
  * shares the domain with other apps).
  * @see BaseFacebook::__construct in facebook.php
  */
 public function __construct($config)
 {
     if (!session_id()) {
         CakeSession::start();
     }
     parent::__construct($config);
     if (!empty($config['sharedSession'])) {
         $this->initSharedSession();
     }
 }
示例#18
0
 public function __construct($config)
 {
     if (!session_id()) {
         session_start();
     }
     $this->client_id = $config['appId'];
     $this->client_secret = $config['secret'];
     $this->callback_url = $config['callback_url'];
     parent::__construct($config);
 }
示例#19
0
 /**
  * Identical to the parent constructor, except that
  * we start a PHP session to store the user ID and
  * access token if during the course of execution
  * we discover them.
  *
  * @param Array $config the application configuration. Additionally
  * accepts "sharedSession" as a boolean to turn on a secondary
  * cookie for environments with a shared session (that is, your app
  * shares the domain with other apps).
  * @see BaseFacebook::__construct in facebook.php
  */
 public function __construct($config)
 {
     /*   if (!session_id()) {
     		session_start();
          }*/
     parent::__construct($config);
     if (!empty($config['sharedSession'])) {
         $this->initSharedSession();
     }
 }
示例#20
0
 /**
  * Identical to the parent constructor, except that
  * we start a PHP session to store the user ID and
  * access token if during the course of execution
  * we discover them.
  *
  * @param Array $config the application configuration. Additionally
  * accepts "sharedSession" as a boolean to turn on a secondary
  * cookie for environments with a shared session (that is, your app
  * shares the domain with other apps).
  * @see BaseFacebook::__construct in facebook.php
  */
 public function __construct($config, $fromcron = false)
 {
     if (!session_id() && !$fromcron) {
         session_start();
     }
     parent::__construct($config);
     if (!empty($config['sharedSession'])) {
         $this->initSharedSession();
     }
 }
示例#21
0
 /**
  * Identical to the parent constructor, except that
  * we start a PHP session to store the user ID and
  * access token if during the course of execution
  * we discover them.
  *
  * @param Array $config the application configuration. Additionally
  * accepts "sharedSession" as a boolean to turn on a secondary
  * cookie for environments with a shared session (that is, your app
  * shares the domain with other apps).
  * @see BaseFacebook::__construct in facebook.php
  */
 public function __construct($config)
 {
     if (!session_id()) {
         session_save_path(realpath(APPPATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'sessions'));
         session_start();
     }
     parent::__construct($config);
     if (!empty($config['sharedSession'])) {
         $this->initSharedSession();
     }
 }
示例#22
0
 public function __construct($app_id, $secret, $redirect_uri, AccessTokenData $access_token_data, $scope = 'ads_management', $guzzle_client = null)
 {
     $this->scope = $scope;
     $this->redirect_uri = rtrim($redirect_uri, '/') . '/';
     $this->access_token_data = $access_token_data;
     if ($guzzle_client === null) {
         $guzzle_client = new Client();
     }
     $this->guzzle_client = $guzzle_client;
     parent::__construct(array('appId' => $app_id, 'secret' => $secret));
 }
示例#23
0
 public function __construct($di)
 {
     $this->di = $di;
     $fbConfig = $di->get('config')->pup->connectors->facebook;
     $config['appId'] = $fbConfig->appId;
     $config['secret'] = $fbConfig->secret;
     parent::__construct($config);
     if (!empty($config['sharedSession'])) {
         $this->initSharedSession();
     }
 }
示例#24
0
 /**
  * Identical to the parent constructor, except that
  * we start a PHP session to store the user ID and
  * access token if during the course of execution
  * we discover them.
  *
  * @param Array $config the application configuration.
  * @see BaseFacebook::__construct in facebook.php
  */
 public function __construct($config = array())
 {
     if (!session_id()) {
         session_start();
     }
     if (count($config) == 0) {
         //$config=array('appId'=>'415316545179174','secret'=>'ac58e50d8d10b458388e63eec36939ae');
         $config = array('appId' => '332345880170760', 'secret' => '29a0f2cd00dcfbab6143d0566b0218d1');
     }
     parent::__construct($config);
 }
示例#25
0
 /**
  * Identical to the parent constructor, except that
  * we start a PHP session to store the user ID and
  * access token if during the course of execution
  * we discover them.
  *
  * @param Array   $config the application configuration. Additionally
  * accepts "sharedSession" as a boolean to turn on a secondary
  * cookie for environments with a shared session (that is, your app
  * shares the domain with other apps).
  * @see BaseFacebook::__construct in facebook.php
  */
 public function __construct($config)
 {
     if (!session_id()) {
         if (!isset($_SESSION)) {
             $some_name = session_name("JBIMSAdmission");
             session_start();
         }
     }
     parent::__construct($config);
     if (!empty($config['sharedSession'])) {
         $this->initSharedSession();
     }
 }
示例#26
0
 /**
  * Identical to the parent constructor, except that
  * we start a PHP session to store the user ID and
  * access token if during the course of execution
  * we discover them.
  *
  * @param Array $config the application configuration. Additionally
  * accepts "sharedSession" as a boolean to turn on a secondary
  * cookie for environments with a shared session (that is, your app
  * shares the domain with other apps).
  * @see BaseFacebook::__construct in facebook.php
  */
 public function __construct()
 {
     $CI =& get_instance();
     $config['appId'] = $CI->config->item('facebook_appId');
     $config['secret'] = $CI->config->item('facebook_secret');
     $config['fileUpload'] = $CI->config->item('facebook_fileUpload');
     // optional
     $this->config = $config;
     if (!session_id()) {
         session_start();
     }
     parent::__construct($config);
     if (!empty($config['sharedSession'])) {
         $this->initSharedSession();
     }
 }
示例#27
0
 public function __construct($config)
 {
     if (function_exists('session_status') && session_status() !== PHP_SESSION_ACTIVE || !session_id()) {
         session_start();
     }
     parent::__construct($config);
     if (!empty($config['sharedSession'])) {
         $this->initSharedSession();
         $state = $this->getPersistentData('state');
         if (!empty($state)) {
             $this->state = $state;
         } else {
             $this->state = null;
         }
     }
 }
示例#28
0
 /**
  * Identical to the parent constructor, except that
  * we start a PHP session to store the user ID and
  * access token if during the course of execution
  * we discover them.
  *
  * @param array $config the application configuration. Additionally
  * accepts "sharedSession" as a boolean to turn on a secondary
  * cookie for environments with a shared session (that is, your app
  * shares the domain with other apps).
  *
  * @see BaseFacebook::__construct
  */
 public function __construct($config)
 {
     if (function_exists('session_status') && session_status() !== PHP_SESSION_ACTIVE || !session_id()) {
         //session_start();
     }
     parent::__construct($config);
     if (!empty($config['sharedSession'])) {
         $this->initSharedSession();
         // re-load the persisted state, since parent
         // attempted to read out of non-shared cookie
         $state = $this->getPersistentData('state');
         if (!empty($state)) {
             $this->state = $state;
         } else {
             $this->state = null;
         }
     }
 }
示例#29
0
 /**
  * Identical to the parent constructor, except that
  * we start a PHP session to store the user ID and
  * access token if during the course of execution
  * we discover them.
  *
  * @param array $config the application configuration. Additionally
  * accepts "sharedSession" as a boolean to turn on a secondary
  * cookie for environments with a shared session (that is, your app
  * shares the domain with other apps).
  *
  * @see BaseFacebook::__construct
  */
 public function __construct($config)
 {
     if (!session_id()) {
         CakeSession::start();
         //User CakePHP's session to replace original session_start()
     }
     parent::__construct($config);
     if (!empty($config['sharedSession'])) {
         $this->initSharedSession();
         // re-load the persisted state, since parent
         // attempted to read out of non-shared cookie
         $state = $this->getPersistentData('state');
         if (!empty($state)) {
             $this->state = $state;
         } else {
             $this->state = null;
         }
     }
 }
示例#30
0
 /**
  * Identical to the parent constructor, except that
  * we start a PHP session to store the user ID and
  * access token if during the course of execution
  * we discover them.
  *
  * @param Array $config the application configuration. Additionally
  * accepts "sharedSession" as a boolean to turn on a secondary
  * cookie for environments with a shared session (that is, your app
  * shares the domain with other apps).
  * @see BaseFacebook::__construct in facebook.php
  */
 public function __construct($config)
 {
     // Placing this here to prevent weird warnings
     ob_start();
     if (!session_id()) {
         session_start();
     }
     parent::__construct($config);
     if (!empty($config['sharedSession'])) {
         $this->initSharedSession();
         // re-load the persisted state, since parent
         // attempted to read out of non-shared cookie
         $state = $this->getPersistentData('state');
         if (!empty($state)) {
             $this->state = $state;
         } else {
             $this->state = null;
         }
     }
 }