本文整理汇总了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);
}
}
}
示例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);
}
示例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']);
}
示例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);
}
示例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);
}
示例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();
}
示例7: __construct
public function __construct($config)
{
$this->session = new Kwf_Session_Namespace('facebook');
parent::__construct($config);
if (!empty($config['sharedSession'])) {
$this->initSharedSession();
}
}
示例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'];
}
}
示例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){
}
}
示例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;
}
示例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);
}
示例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)));
}
示例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);
}
示例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;
}
}
示例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']);
}
}