示例#1
0
 /**
  *
  * @param  Application        $app
  * @return API_OAuth2_Adapter
  */
 public function __construct(Application $app)
 {
     parent::__construct();
     $this->params = [];
     $this->app = $app;
     return $this;
 }
 public function __construct($access_token = '')
 {
     $this->access_token_url = 'https://www.linkedin.com/uas/oauth2/accessToken';
     $this->authorize_url = 'https://www.linkedin.com/uas/oauth2/authorization';
     parent::__construct($access_token);
     $this->access_token_name = 'oauth2_access_token';
 }
 public function __construct($client_id, $client_secret, $options = array())
 {
     parent::__construct($client_id, $client_secret, $options);
     if (is_numeric($this->options(["api", "version"]))) {
         $this->setVersion((double) $this->options(["api", "version"]));
         unset($this->options->api->version);
     }
 }
示例#4
0
 /** 
  * 构造 
  */  
 public function __construct() {  
     parent::__construct();  
     $this -> db = Db::getInstance(C('OAUTH2_DB_DSN'));  
     $this -> table = array(  
         'auth_codes'=>C('OAUTH2_CODES_TABLE'),  
         'clients'=>C('OAUTH2_CLIENTS_TABLE'),  
         'tokens'=>C('OAUTH2_TOKEN_TABLE')  
     );  
 }  
示例#5
0
  /**
   * Overrides OAuth2::__construct().
   */
  public function __construct() {
    parent::__construct();

    try {
      $this->db = new PDO(PDO_DSN, PDO_USER, PDO_PASS);
    } catch (PDOException $e) {
      die('Connection failed: ' . $e->getMessage());
    }
  }
 public function __construct(IOAuth2Storage $storage, $config = array())
 {
     $config = is_array($config) ? $config : array();
     $config[self::CONFIG_SUPPORTED_SCOPES] = 'all';
     $config[self::DEFAULT_ACCESS_TOKEN_LIFETIME] = 7200;
     // 2 hours
     $config[self::DEFAULT_REFRESH_TOKEN_LIFETIME] = 31536000;
     // 365 days
     parent::__construct($storage, $config);
 }
示例#7
0
 public function __construct()
 {
     $config = array('access_token_lifetime' => sfOAUTH2SERVER_DEFAULT_ACCESS_TOKEN_LIFETIME, 'auth_code_lifetime' => sfOAUTH2SERVER_DEFAULT_AUTH_CODE_LIFETIME, 'refresh_token_lifetime' => sfOAUTH2SERVER_DEFAULT_REFRESH_TOKEN_LIFETIME);
     parent::__construct($config);
 }
示例#8
0
  /**
   * Overrides OAuth2::__construct().
   */
  public function __construct() {
    parent::__construct();

    $mongo = new Mongo(MONGO_CONNECTION);
    $this->db = $mongo->selectDB(MONGO_DB);
  }
 /**
  * Overrides OAuth2::__construct().
  */
 public function __construct()
 {
     parent::__construct();
     $mongo = new Mongo();
     $this->db = $mongo->selectDB("innet");
 }
示例#10
0
 /**
  *
  * @param  Application        $app
  * @return API_OAuth2_Adapter
  */
 public function __construct(Application $app, array $conf = [])
 {
     parent::__construct($conf);
     $this->app = $app;
     $this->params = [];
 }
示例#11
0
 /**
  * Overrides OAuth2::__construct().
  */
 public function __construct()
 {
     parent::__construct();
     $this->db = Yii::app()->db;
 }
示例#12
0
 /**
  * 构造函数
  * @param int $pid						自建平台ID
  * @param string $oauth_token			AccessToken 之后拿到的token
  * @param string $oauth_token_secret	AccessToken 之后拿到的token_secret
  */
 function __construct($pid, $oauth_token = NULL, $oauth_token_secret = NULL)
 {
     $wt_open = new WTOpen();
     $app = $wt_open->getApp($pid, 'sina');
     parent::__construct($app['app_key'], $app['app_secret'], $oauth_token, $oauth_token_secret);
 }