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


PHP Facebook::__construct方法代码示例

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


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


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