當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Client::__construct方法代碼示例

本文整理匯總了PHP中Guzzle\Http\Client::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP Client::__construct方法的具體用法?PHP Client::__construct怎麽用?PHP Client::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Guzzle\Http\Client的用法示例。


在下文中一共展示了Client::__construct方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 public function __construct($baseUrl = '', $config = null, $tokens = null)
 {
     if ($tokens) {
         $this->setUserTokens($tokens);
     }
     parent::__construct($baseUrl, $config);
 }
開發者ID:besimhu,項目名稱:CraftCMS-Boilerplate,代碼行數:7,代碼來源:OAuthClient.php

示例2: __construct

 public function __construct($emailAddress, $apiToken, $apiUrl)
 {
     $this->emailAddress = $emailAddress;
     $this->apiToken = $apiToken;
     $this->apiUrl = $apiUrl;
     parent::__construct($apiUrl, array('curl.options' => array('CURLOPT_FOLLOWLOCATION' => 1, 'CURLOPT_MAXREDIRS' => 10, 'CURLOPT_TIMEOUT' => 10, 'CURLOPT_USERPWD' => $emailAddress . '/token:' . $apiToken)));
     $this->setDefaultHeaders(array('Content-type' => 'application/json', 'User-Agent' => 'MozillaXYZ/1.0'));
 }
開發者ID:nebijokit,項目名稱:zendesk,代碼行數:8,代碼來源:ZendeskApi.php

示例3: __construct

 public function __construct($api_key, $url = 'https://bigboard.us')
 {
     parent::__construct();
     $this->setBaseUrl($url);
     $this->setSslVerification(false, false, false);
     $this->setUserAgent("BigBoardSDK/0.1");
     $this->setDefaultOption('headers', array('X-BigBoard-Token' => $api_key, 'Content-Type' => "text/json"));
 }
開發者ID:fromtheoutfit,項目名稱:bigboard-sdk-php,代碼行數:8,代碼來源:APIClient.php

示例4: __construct

 public function __construct($baseUrl = '', $config = null)
 {
     // @codeCoverageIgnoreStart
     if (PHP_VERSION < self::MINIMUM_PHP_VERSION) {
         throw new UnsupportedVersionError(sprintf('You must have PHP version >= %s installed.', self::MINIMUM_PHP_VERSION));
     }
     // @codeCoverageIgnoreEnd
     parent::__construct($baseUrl, $config);
 }
開發者ID:isrealconsulting,項目名稱:site,代碼行數:9,代碼來源:Client.php

示例5: __construct

 /**
  * Public constructor.
  *
  * Enables backoff support.
  *
  * @param string $baseUrl Base URL of the web service.
  * @param string $backoffRegex Optional error pattern to
  *                             search for in response bodies.
  */
 public function __construct($baseUrl = '', $backoffRegex = null)
 {
     if (is_string($backoffRegex)) {
         $backoffPlugin = new BackoffPlugin(new ResponseMatchesBackoffStrategy($backoffRegex));
     } else {
         $backoffPlugin = BackoffPlugin::getExponentialBackoff();
     }
     $config = array('request.options' => array('plugins' => array($backoffPlugin)));
     parent::__construct($baseUrl, $config);
 }
開發者ID:lfbittencourt,項目名稱:php-scraping-toolkit,代碼行數:19,代碼來源:Client.php

示例6: __construct

 public function __construct($baseUrl = '', $config = null, ProviderInterface $provider = null, AccessToken $tokens = null)
 {
     if ($tokens) {
         $this->setUserTokens($tokens);
     }
     if ($provider) {
         $this->setProvider($provider);
     }
     parent::__construct($baseUrl, $config);
 }
開發者ID:chrisnharvey,項目名稱:oauth1,代碼行數:10,代碼來源:Client.php

示例7: __construct

 /**
  * Build a new Http request
  * @param array  $auth    [apikey, apisecret]
  * @param string $method  http method
  * @param string $url     call url
  * @param array  $filters Mailjet resource filters
  * @param array  $body    Mailjet resource body
  * @param string $type    Request Content-type
  */
 public function __construct($auth, $method, $url, $filters, $body, $type)
 {
     parent::__construct();
     $this->setUserAgent(Config::USER_AGENT . phpversion() . '/' . Client::WRAPPER_VERSION);
     $this->type = $type;
     $this->auth = $auth;
     $this->method = $method;
     $this->url = $url;
     $this->filters = $filters;
     $this->body = $body;
 }
開發者ID:amosoft,項目名稱:mailjet-apiv3-php,代碼行數:20,代碼來源:Request.php

示例8: __construct

 /**
  * @param array       $config
  * @param string|null $proxy
  */
 public function __construct(array $config, $proxy = null)
 {
     $defaults = ['base_url' => 'https://btc-e.com/'];
     $required = ['base_url', 'api_key', 'api_secret'];
     if (null !== $proxy) {
         $defaults[self::REQUEST_OPTIONS] = ['proxy' => $proxy, 'verify' => false];
     }
     $config = Collection::fromConfig($config, $defaults, $required);
     $this->apiKey = $config->get('api_key');
     $this->apiSecret = $config->get('api_secret');
     $config->set('exceptions', false);
     parent::__construct($config->get('base_url'), $config);
 }
開發者ID:alsma,項目名稱:btce-connector,代碼行數:17,代碼來源:Client.php

示例9: __construct

 public function __construct($token)
 {
     $url = sprintf($token);
     parent::__construct($url);
     //$this->setDefaultOption('query', array('token' => $token));
 }
開發者ID:stewarty,項目名稱:slack-notifier,代碼行數:6,代碼來源:Client.php

示例10: __construct

 public function __construct()
 {
     parent::__construct(Keyring::getAppUrlRegion());
 }
開發者ID:arthurwayne,項目名稱:ovh-sdk-php,代碼行數:4,代碼來源:AbstractClient.php

示例11: __construct

 public function __construct($baseUrl)
 {
     parent::__construct($baseUrl);
 }
開發者ID:veggiemeat,項目名稱:php-cometdocs,代碼行數:4,代碼來源:Client.php

示例12: __construct

 public function __construct($team, $token)
 {
     $url = sprintf("https://%s.slack.com", $team);
     parent::__construct($url);
     $this->setDefaultOption('query', array('token' => $token));
 }
開發者ID:polem,項目名稱:slack-notifier,代碼行數:6,代碼來源:Client.php

示例13: __construct

 public function __construct(array $config = array())
 {
     parent::__construct('', $config);
     $this->config = array_merge($this->config, $config);
 }
開發者ID:newscoop,項目名稱:plugin-IngestParser-SuperdeskContentAPI,代碼行數:5,代碼來源:GuzzleClient.php

示例14: __construct

 public function __construct($baseUrl = '', $config = null)
 {
     parent::__construct($baseUrl, $config);
     $cookiePlugin = new CookiePlugin(new ArrayCookieJar());
     $this->addSubscriber($cookiePlugin);
 }
開發者ID:werkint,項目名稱:httpclient,代碼行數:6,代碼來源:Client.php

示例15: __construct

 public function __construct($baseUrl)
 {
     parent::__construct();
     $this->setUserAgent(self::USER_AGENT);
     $this->setBaseUrl($baseUrl);
 }
開發者ID:ChiarilloMassimo,項目名稱:YandexTranslatorBundle,代碼行數:6,代碼來源:Client.php


注:本文中的Guzzle\Http\Client::__construct方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。