Пример #1
0
 public function __construct($consumerKeys)
 {
     $this->consumerKeys = $consumerKeys;
     parent::__construct($consumerKeys);
     if (session_status() == PHP_SESSION_NONE) {
         session_start();
     }
 }
Пример #2
0
 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
0
 public function __construct($config = array())
 {
     $this->config = array_merge(array('consumer_key' => 'ptOjSuaCXjI4zmBMrRzdkKmzH', 'consumer_secret' => '99ytYeHhCfZaxIp1Ca0rdlfe8h1GB11lPwuYihLClsFAOOthXw', 'token' => '3247662382-HKQGaMo9cCds5erYUi5JJIvaGHRfWZEtLO5v4qE', 'secret' => 'hwsmEXRzwLAGz40xMtX5XK7FCZul1CRIOGLiVpu9jHVps', 'bearer' => '3247662382-HKQGaMo9cCds5erYUi5JJIvaGHRfWZEtLO5v4qE', '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);
 }
 public function __construct($config = array())
 {
     $this->config = array_merge(array('consumer_key' => 'YOUR_CONSUMER_KEY', 'consumer_secret' => 'YOUR_CONSUMER_SECRET', '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);
 }
Пример #5
0
 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);
 }
Пример #6
0
 /**
  * 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);
 }
 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);
 }
Пример #8
0
 public function __construct(array $config, $code)
 {
     parent::__construct($config);
     $this->code = $code;
 }