Пример #1
0
 public function __construct($url, $method = 'GET', $headers = array(), $postBody = null)
 {
     $this->setUrl($url);
     $this->setRequestMethod($method);
     $this->setRequestHeaders($headers);
     $this->setPostBody($postBody);
     if (Config::has('application_name')) {
         $this->userAgent = Config::get('application_name') . " " . self::USER_AGENT_SUFFIX;
     } else {
         $this->userAgent = self::USER_AGENT_SUFFIX;
     }
 }
Пример #2
0
 /**
  * Instantiates the class, but does not initiate the login flow, leaving it
  * to the discretion of the caller (which is done by calling authenticate()).
  */
 public function __construct()
 {
     if (Config::has('developer_key')) {
         $this->developerKey = Config::get('developer_key');
     }
     if (Config::has('oauth2_client_id')) {
         $this->clientId = Config::get('oauth2_client_id');
     }
     if (Config::has('oauth2_client_secret')) {
         $this->clientSecret = Config::get('oauth2_client_secret');
     }
     if (Config::has('oauth2_redirect_uri')) {
         $this->redirectUri = Config::get('oauth2_redirect_uri');
     }
     if (Config::has('oauth2_access_type')) {
         $this->accessType = Config::get('oauth2_access_type');
     }
     if (Config::has('oauth2_approval_prompt')) {
         $this->approvalPrompt = Config::get('oauth2_approval_prompt');
     }
 }
Пример #3
0
 public function __construct()
 {
     if (Config::has('developer_key')) {
         $this->setDeveloperKey(Config::get('developer_key'));
     }
 }