本文整理汇总了PHP中tmhOAuth::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP tmhOAuth::__construct方法的具体用法?PHP tmhOAuth::__construct怎么用?PHP tmhOAuth::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tmhOAuth
的用法示例。
在下文中一共展示了tmhOAuth::__construct方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($consumerKeys)
{
$this->consumerKeys = $consumerKeys;
parent::__construct($consumerKeys);
if (session_status() == PHP_SESSION_NONE) {
session_start();
}
}
示例2: __construct
public function __construct($config = array())
{
$this->config = array_merge(array('consumer_key' => 'AHbD6KOwFcUp57JJ8ofTw', 'consumer_secret' => 'lxwPpSvedHIEQpevtPChGPuZk4awsVWECx5wUwE3R4', 'token' => 'A_USER_TOKEN', 'secret' => 'A_USER_SECRET', 'bearer' => 'YOUR_OAUTH2_TOKEN', 'user_agent' => 'tmhOAuth ' . parent::VERSION . ' Examples 0.1'), $config);
if (file_exists(__DIR__ . DIRECTORY_SEPARATOR . 'tmh_myconfig.php')) {
include __DIR__ . DIRECTORY_SEPARATOR . 'tmh_myconfig.php';
$this->config = array_merge($this->config, tmh_myconfig());
}
parent::__construct($this->config);
}
示例3: __construct
public function __construct($config = array())
{
global $twitter_oauth;
//dan edit
$this->config = array_merge(array('consumer_key' => $twitter_oauth["consumer_key"], 'consumer_secret' => $twitter_oauth["consumer_secret"], 'token' => $twitter_oauth["token"], 'secret' => $twitter_oauth["secret"], 'bearer' => 'XXXXXXXXXXXX', 'user_agent' => 'tmhOAuth ' . parent::VERSION . ' Examples 0.1'), $config);
if (file_exists(__DIR__ . DIRECTORY_SEPARATOR . 'tmh_myconfig.php')) {
include __DIR__ . DIRECTORY_SEPARATOR . 'tmh_myconfig.php';
$this->config = array_merge($this->config, tmh_myconfig());
}
parent::__construct($this->config);
}
示例4: __construct
/**
* Twitter constructor.
*
* @param Config $config
* @param SessionStore $session
*/
public function __construct(Config $config, SessionStore $session)
{
$this->tconfig = Settings::get('ttwitter');
$client_id = Settings::get('services.twitter.client_id');
$client_secret = Settings::get('services.twitter.client_secret');
$this->tconfig['CONSUMER_KEY'] = isset($client_id) && !empty($client_id) ? $client_id : $this->tconfig['CONSUMER_KEY'];
$this->tconfig['CONSUMER_SECRET'] = isset($client_secret) && !empty($client_secret) ? $client_secret : $this->tconfig['CONSUMER_SECRET'];
if (empty($this->tconfig)) {
throw new Exception('No config found');
}
$this->debug = isset($this->tconfig['debug']) && $this->tconfig['debug'] ? true : false;
$this->parent_config = ['consumer_key' => $this->tconfig['CONSUMER_KEY'], 'consumer_secret' => $this->tconfig['CONSUMER_SECRET'], 'token' => $this->tconfig['ACCESS_TOKEN'], 'secret' => $this->tconfig['ACCESS_TOKEN_SECRET']];
if ($session->has('access_token')) {
$access_token = $session->get('access_token');
if (is_array($access_token) && isset($access_token['oauth_token']) && isset($access_token['oauth_token_secret']) && !empty($access_token['oauth_token']) && !empty($access_token['oauth_token_secret'])) {
$this->parent_config['token'] = $access_token['oauth_token'];
$this->parent_config['secret'] = $access_token['oauth_token_secret'];
}
}
$this->parent_config['use_ssl'] = $this->tconfig['USE_SSL'];
$this->parent_config['user_agent'] = 'LTTW ' . parent::VERSION;
parent::__construct($this->parent_config);
}
示例5: __construct
public function __construct($config = array())
{
$this->config = array_merge(array('consumer_key' => module_config::c('social_twitter_api_key', ''), 'consumer_secret' => module_config::c('social_twitter_api_secret', ''), 'user_agent' => 'UCM Twitter 0.1'), $config);
parent::__construct($this->config);
}
示例6: __construct
public function __construct(array $config, $code)
{
parent::__construct($config);
$this->code = $code;
}