예제 #1
0
 public function __construct()
 {
     $CI =& get_instance();
     /*
      * ucitavamo facebook appId i secret iz mape config datoteka facebook.php
      *  TRUE se stavlja zato da bi vrijednosti bile u array-u
      */
     $CI->config->load('facebook', TRUE);
     /*
      * napravimo taj array
      *   na pr. echo $config['appId'];
      */
     $config = $CI->config->item('facebook');
     /*
      *  moramo napraviti ikonstruktor za klasu facebook
      * kojoj kao knfiguraciu dajemo appId i secret
      */
     parent::__construct($config);
     /*
      *  funkcija getUser vraca korisnikov Facebook id
      */
     $this->user_id = $this->getUser();
     /*
      * $me je facebook objekt
      */
     $me = null;
     if ($this->user_id) {
         try {
             $me = $this->api('/me');
             $this->user = $me;
         } catch (FacebookApiException $e) {
             error_log($e);
         }
     }
 }
예제 #2
0
 /**
  * Facebook wrapper constructor
  * You must pass in the appId and secret for this to work properly
  * The configuration:
  * - appId: the application ID
  * - secret: the application secret
  * - fileUpload: (optional) boolean indicating if file uploads are enabled
  * @param array $config array of settings required to initiate the class successfully  
  * @return void
  * @throws FBException
  */
 public function __construct($config)
 {
     if (!isset($config['appId']) || !isset($config['secret'])) {
         throw new FBException('Sorry, You must specify the appId and secret when initializing the class.', 500);
     }
     parent::__construct($config);
 }
예제 #3
0
파일: fb.php 프로젝트: joffuk/modulargaming
 /**
  * Create new Facebook client
  *
  * @param  bool  $generate_session_secret
  */
 public function __construct()
 {
     // Load config
     $this->config = Kohana::config('facebook');
     // Init Facebook client
     parent::__construct($this->config['api_key'], $this->config['secret']);
 }
예제 #4
0
파일: Facebook.php 프로젝트: nabble/ajde
 public function __construct($config = [])
 {
     $this->_key = config('services.facebook.key');
     $this->_secret = config('services.facebook.secret');
     $config = array_merge($config, ['appId' => $this->_key, 'secret' => $this->_secret]);
     parent::__construct($config);
 }
예제 #5
0
 /**
  * Sets default application parameters - FB application ID,
  * secure key and cookie support.
  *
  * @return null
  */
 public function __construct()
 {
     $oConfig = oxConfig::getInstance();
     $aFbConfig["appId"] = $oConfig->getConfigParam("sFbAppId");
     $aFbConfig["secret"] = $oConfig->getConfigParam("sFbSecretKey");
     $aFbConfig["cookie"] = true;
     parent::__construct($aFbConfig);
 }
 /**
  * @param array $config
  * @param \Nette\Application\Application $application
  * @param \Nette\Http\Response $httpResponse
  */
 public function __construct(array $config, \Nette\Application\Application $application, \Nette\Http\Response $httpResponse)
 {
     parent::__construct($config);
     $this->config = $config;
     $this->application = $application;
     $this->httpResponse = $httpResponse;
     $this->setHeaders();
 }
 public function __construct($config)
 {
     $this->session = new Kwf_Session_Namespace('facebook');
     parent::__construct($config);
     if (!empty($config['sharedSession'])) {
         $this->initSharedSession();
     }
 }
예제 #8
0
 public function __construct($config)
 {
     parent::__construct($config);
     if (isset($config['proxy.host']) && isset($config['proxy.port'])) {
         self::$CURL_OPTS[CURLOPT_HTTPPROXYTUNNEL] = 'true';
         self::$CURL_OPTS[CURLOPT_PROXY] = $config['proxy.host'];
         self::$CURL_OPTS[CURLOPT_PROXYPORT] = $config['proxy.port'];
     }
 }
예제 #9
0
 public function __construct($config) {
     parent::__construct($config);
     $this->kt = null;
     try{
         /* If Kontagent is not included, it will still work*/
         $this->kt = new Kontagent(KT_API_SERVER, KT_API_KEY, SEND_MSG_VIA_JS);
     }catch(Exception $e){
         
     }
 }
 public function __construct($config)
 {
     parent::__construct($config);
     $CURL_OPTS['CURLOPT_CONNECTTIMEOUT'] = 30;
     $CURL_OPTS['CURLOPT_RETURNTRANSFER'] = true;
     $CURL_OPTS['CURLOPT_TIMEOUT'] = 60;
     $CURL_OPTS['CURLOPT_USERAGENT'] = 'SocialXE Communicator';
     $CURL_OPTS['CURLOPT_SSL_VERIFYPEER'] = false;
     $CURL_OPTS['CURLOPT_SSL_VERIFYHOST'] = 2;
 }
예제 #11
0
 public function __construct(array $config = Null)
 {
     $this->_config = Kohana::config('facebook.default');
     if (isset($config)) {
         $this->_config = Arr::merge($this->_config, $config);
     }
     $api_key = $this->get_config('api_key');
     $secret = $this->get_config('secret');
     $generate_session_secret = $this->get_config('generate_session_secret', FALSE);
     parent::__construct($api_key, $secret, $generate_session_secret);
 }
 /**
  * @param sfEventDispatcher $dispatcher
  * @param array $options
  */
 public function __construct(sfEventDispatcher $dispatcher, $options = array())
 {
     $this->dispatcher = $dispatcher;
     if (!sfConfig::get('app_sf_facebook_plugin_app_id', false)) {
         throw new sfException(sprintf('You need to configure an app id'));
     }
     if (!sfConfig::get('app_sf_facebook_plugin_app_secret', false)) {
         throw new sfException(sprintf('You need to configure an app secret'));
     }
     parent::__construct(array('appId' => sfConfig::get('app_sf_facebook_plugin_app_id'), 'secret' => sfConfig::get('app_sf_facebook_plugin_app_secret'), 'cookie' => true, 'domain' => sfConfig::get('app_sf_facebook_plugin_cookie_domain', $_SERVER['SERVER_NAME']), 'fileUpload' => sfConfig::get('app_sf_facebook_plugin_enable_fileuploads', false)));
 }
예제 #13
0
 public function __construct()
 {
     global $wgFbAppId, $wgFbSecret;
     // Check to make sure config.default.php was renamed properly, unless we
     // are running update.php from the command line
     // TODO: use $wgCommandLineMode, if it is propper to do so
     if (!defined('MW_CMDLINE_CALLBACK') && !self::isConfigSetup()) {
         die('<strong>Please update $wgFbAppId and $wgFbSecret.</strong>');
     }
     $config = array('appId' => $wgFbAppId, 'secret' => $wgFbSecret, 'fileUpload' => false);
     parent::__construct($config);
 }
예제 #14
0
파일: FB.php 프로젝트: anqqa/Anqh
 /**
  * Create new Facebook client
  *
  * @param  bool  $generate_session_secret
  */
 public function __construct()
 {
     // Allow only one instance
     if (FB::$instance === null) {
         // Load config
         if (!is_array(FB::$config)) {
             FB::$config = Kohana::config('facebook');
         }
         // Init Facebook client
         parent::__construct(FB::$config['api_key'], FB::$config['secret']);
         FB::$instance = $this;
     }
 }
예제 #15
0
 public function __construct($config)
 {
     parent::__construct($config);
     if (isset($config['appName'])) {
         $this->setAppName($config['appName']);
     }
     if (isset($config['canvasPage'])) {
         $this->setCanvasPage($config['canvasPage']);
     }
     if (isset($config['canvasUrl'])) {
         $this->setCanvasUrl($config['canvasUrl']);
     }
 }
예제 #16
0
 function __construct($conf = array())
 {
     if (!isset($conf['appId'])) {
         $conf['appId'] = variable_get('fb_autopost_app_id', '');
     }
     if (!isset($conf['secret'])) {
         $conf['secret'] = variable_get('fb_autopost_app_secret', '');
     }
     $this->destination = NULL;
     $this->retry = TRUE;
     // Delete any previously saved publication in the session.
     $this->getSession()->removePublication();
     parent::__construct($conf);
 }
 public function __construct($fb_api_key, $fb_secret_key, $backend_api_key, $backend_secret_key, $backend_host, $backend_port, $backend_url, $canvas_url, $call_back_req_uri)
 {
     parent::__construct($fb_api_key, $fb_secret_key);
     // override the original api_client with our own.
     $this->api_client = new Kt_FacebookRestClient($fb_api_key, $fb_secret_key, $backend_api_key, $backend_secret_key, $backend_host, $backend_port, $backend_url, $canvas_url, $call_back_req_uri);
     // Mirroring what parent has done. Yes, it's a called twice, but this is to ensure
     // that our version of api_client is set up properly.
     $this->validate_fb_params();
     if (isset($this->fb_params['friends'])) {
         $this->api_client->friends_list = explode(',', $this->fb_params['friends']);
     }
     if (isset($this->fb_params['added'])) {
         $this->api_client->added = $this->fb_params['added'];
     }
 }
예제 #18
0
 public function Fbconnect()
 {
     $ci =& get_instance();
     $ci->config->load('facebook', TRUE);
     $config = $ci->config->item('facebook');
     parent::__construct($config);
     $this->user_id = $this->getUser();
     $me = null;
     if ($this->user_id) {
         try {
             $me = $this->api('/me');
             $this->user = $me;
         } catch (FacebookApiException $e) {
             error_log($e);
         }
     }
 }
예제 #19
0
 public function Fbconnect()
 {
     $ci =& get_instance();
     $ci->config->load('facebook', TRUE);
     $config = $ci->config->item('facebook');
     parent::__construct($config);
     parse_str(substr(strrchr($_SERVER['REQUEST_URI'], "?"), 1), $_REQUEST);
     $this->user_id = $this->getUser();
     $me = null;
     if ($this->user_id) {
         try {
             $me = $this->api('/v2.3/me');
             $this->user = $me;
         } catch (FacebookApiException $e) {
             error_log($e);
         }
     }
 }
예제 #20
0
 /**
  * Constructor
  *
  * @throws Exception
  */
 public function __construct()
 {
     /*
     		if (!class_exists('Facebook')) {
     			throw new Exception('Facebook PHP SDK not found');
     		}
     */
     if (!Configure::read('Facebook')) {
         throw new Exception('Facebook configuration not loaded');
     }
     // @todo implement other config params
     $this->config = array('appId' => Configure::read('Facebook.appId'), 'secret' => Configure::read('Facebook.appSecret'));
     if (self::$version > self::API_VERSION_UNVERSIONED) {
         $version = 'v' . self::$version;
         self::$DOMAIN_MAP = array('api' => 'https://api.facebook.com/' . $version . '/', 'api_video' => 'https://api-video.facebook.com/' . $version . '/', 'api_read' => 'https://api-read.facebook.com/' . $version . '/', 'graph' => 'https://graph.facebook.com/' . $version . '/', 'graph_video' => 'https://graph-video.facebook.com/' . $version . '/', 'www' => 'https://www.facebook.com/' . $version . '/', 'www-unversioned' => 'https://www.facebook.com/');
     }
     //$this->FB = new Facebook($this->config);
     parent::__construct($this->config);
 }
예제 #21
0
 function __construct()
 {
     $CI =& get_instance();
     $CI->config->load('facebook');
     $this->config['appId'] = $CI->config->item('facebook_appId');
     $this->config['secret'] = $CI->config->item('facebook_secret');
     $this->config['fileUpload'] = $CI->config->item('facebook_fileUpload');
     // optional
     $this->scope = $CI->config->item('facebook_scope');
     parent::__construct($this->config);
     $this->user_id = $this->getUser();
     $me = null;
     if ($this->user_id) {
         try {
             $me = $this->api('/me');
             $this->user = $me;
         } catch (FacebookApiException $e) {
             error_log($e);
         }
     }
 }
예제 #22
0
 function __construct($config = array())
 {
     parent::__construct($config);
 }
예제 #23
0
 public function __construct($api_key, $secret)
 {
     $this->app_secret = $secret;
     $this->verify_sig = false;
     parent::__construct($api_key, $secret);
 }
예제 #24
0
 /**
  * 初始化接口
  *
  * @return Facebook_Api
  */
 public function __construct()
 {
     parent::__construct(array('appId' => Core_Game::$appid, 'secret' => Core_Game::$secret, 'fileUpload' => true));
     $this->setRedUri(Core_Game::$appUrl);
     //设置跳转地址
 }
 /**
  * Initialize a Facebook Application.
  *
  * The configuration:
  * - appId: the application API key
  * - secret: the application secret
  * - cookie: (optional) boolean true to enable cookie support
  * - domain: (optional) domain for the cookie
  *
  * @param Array the application configuration
  */
 public function __construct($config)
 {
     parent::__construct($config);
 }
예제 #26
0
파일: Facebook.php 프로젝트: rajarshc/Rooja
 public function __construct($config = array())
 {
     $config = $this->_prepareConfig($config);
     return parent::__construct($config);
 }
예제 #27
0
 function __construct()
 {
     if ($this->isActiveMode()) {
         parent::__construct(array('appId' => $GLOBALS['CONF']['fb_apikey'], 'secret' => $GLOBALS['CONF']['fb_skey'], 'cookie' => true));
     }
 }
예제 #28
0
 public function Rapp_fb_rido()
 {
     $this->_ci =& get_instance();
     $config = array('appId' => $this->_ci->config->item('appId'), 'secret' => $this->_ci->config->item('secret'), 'fileUpload' => TRUE, 'cookie' => TRUE);
     parent::__construct($config);
 }
예제 #29
0
파일: fb.php 프로젝트: enormego/EightPHP
 public function __construct()
 {
     parent::__construct(Eight::config('facebook.api_key'), Eight::config('facebook.secret'));
 }
예제 #30
0
 public function __construct()
 {
     $this->ci =& get_instance();
     $this->ci->load->config('social');
     parent::__construct(array('appId' => $this->ci->config->item('facebook_app_id'), 'secret' => $this->ci->config->item('facebook_app_secret')));
 }