当前位置: 首页>>代码示例>>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;未经允许,请勿转载。