当前位置: 首页>>代码示例>>PHP>>正文


PHP Facebook::__construct方法代码示例

本文整理汇总了PHP中Facebook::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Facebook::__construct方法的具体用法?PHP Facebook::__construct怎么用?PHP Facebook::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Facebook的用法示例。

在下文中一共展示了Facebook::__construct方法的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: __construct

 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);
         }
     }
 }
开发者ID:DraganValjak,项目名称:job-board,代码行数:35,代码来源:Fbconnect.php


示例2: __construct

 /**
  * 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);
 }
开发者ID:Sibzsolutions,项目名称:Savostore,代码行数:18,代码来源:FB.php


示例3: __construct

 /**
  * 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']);
 }
开发者ID:joffuk,项目名称:modulargaming,代码行数:12,代码来源:fb.php


示例4: __construct

 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);
 }
开发者ID:nabble,项目名称:ajde,代码行数:7,代码来源:Facebook.php


示例5: __construct

 /**
  * 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);
 }
开发者ID:JulianaSchuster,项目名称:oxid-frontend,代码行数:14,代码来源:oxfb.php


示例6: __construct

 /**
  * @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();
 }
开发者ID:illagrenan,项目名称:nette-facebook-connect,代码行数:13,代码来源:FacebookConnect.php


示例7: __construct

 public function __construct($config)
 {
     $this->session = new Kwf_Session_Namespace('facebook');
     parent::__construct($config);
     if (!empty($config['sharedSession'])) {
         $this->initSharedSession();
     }
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:8,代码来源:FacebookZendSession.php


示例8: __construct

 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'];
     }
 }
开发者ID:BGCX067,项目名称:facebook-store-svn-to-git,代码行数:9,代码来源:Api.php


示例9: __construct

 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){
         
     }
 }
开发者ID:noahm,项目名称:kontagent-php-sdk,代码行数:10,代码来源:kt_facebook.php


示例10: __construct

 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;
 }
开发者ID:leehankyeol,项目名称:module-server,代码行数:10,代码来源:facebook_socialxe.php


示例11: __construct

 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);
 }
开发者ID:jerfowler,项目名称:kohana-facebook,代码行数:11,代码来源:facebook.php


示例12: __construct

 /**
  * @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)));
 }
开发者ID:JoshuaEstes,项目名称:sfDoctrineFacebookPlugin,代码行数:15,代码来源:sfFacebook.class.php


示例13: __construct

 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);
 }
开发者ID:Jobava,项目名称:diacritice-meta-repo,代码行数:12,代码来源:FacebookAPI.php


示例14: __construct

 /**
  * 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;
     }
 }
开发者ID:anqqa,项目名称:Anqh,代码行数:18,代码来源:FB.php


示例15: __construct

 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']);
     }
 }
开发者ID:rjuppa,项目名称:viral_startup,代码行数:13,代码来源:FacebookWrapper.php


示例16: array

 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);
 }
开发者ID:AlexandrTerekhin,项目名称:mysite,代码行数:14,代码来源:FBAutopost.php


示例17: __construct

 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'];
     }
 }
开发者ID:noitcudni,项目名称:Kontagent-PHP-Library,代码行数:15,代码来源:kt_facebook.php


示例18: Fbconnect

 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);
         }
     }
 }
开发者ID:Nitsin,项目名称:nfly_v1,代码行数:17,代码来源:Fbconnect.php


示例19: Fbconnect

 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);
         }
     }
 }
开发者ID:nathanaelito,项目名称:clickbuena_ci,代码行数:18,代码来源:Fbconnect.php


示例20: __construct

 /**
  * 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);
 }
开发者ID:fm-labs,项目名称:cakephp-facebook,代码行数:24,代码来源:FacebookApi.php



注:本文中的Facebook::__construct方法示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。