当前位置: 首页>>代码示例>>PHP>>正文


PHP Client::__construct方法代码示例

本文整理汇总了PHP中Zend\Http\Client::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::__construct方法的具体用法?PHP Client::__construct怎么用?PHP Client::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend\Http\Client的用法示例。


在下文中一共展示了Client::__construct方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * establish all parameters to another YAWIK instance
  * these are quite good default-parameter for all REST-Clients
  *
  * notice: PHP_AUTH_USER and PHP_AUTH_PW are the basic-authentification parameter,
  * they are set by setAuth($user, $pw). It will be replaced by oAuth2.
  * at the client they are with available at the $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW'] again
  * @param null|string $uri
  * @param array $config
  */
 public function __construct($uri, array $config)
 {
     $this->config = $config;
     $config = ArrayUtils::merge(array('adapter' => 'Zend\\Http\\Client\\Adapter\\Curl', 'keepalive' => false, 'encodecookies' => false, 'outputstream' => false, 'httpversion' => Request::VERSION_11, 'storeresponse' => false, 'maxredirects' => 2), $config);
     parent::__construct($uri, $config);
     $this->setEncType('application/json');
     $this->authetificate();
 }
开发者ID:webpants,项目名称:YAWIK,代码行数:18,代码来源:RestClient.php

示例2: __construct

 public function __construct($uri = nulal, $options = null, $token = null)
 {
     if ($uri === null) {
         $uri = self::URL_API_TELEGRAM;
     }
     if ($token !== null) {
         $this->setToken($token);
     }
     parent::__construct($uri, $options);
 }
开发者ID:jorgeluizjr,项目名称:telegram,代码行数:10,代码来源:Client.php

示例3: __construct

 /**
  * Constructor; creates a new HTTP Client instance which itself is
  * just a typical Zend_HTTP_Client subclass with some OAuth icing to
  * assist in automating OAuth parameter generation, addition and
  * cryptographioc signing of requests.
  *
  * @param  array $oauthOptions
  * @param  string $uri
  * @param  array|\Zend\Config\Config $config
  * @return void
  */
 public function __construct($oauthOptions, $uri = null, $config = null)
 {
     parent::__construct($uri, $config);
     $this->_config = new Config\StandardConfig();
     if ($oauthOptions !== null) {
         if ($oauthOptions instanceof \Zend\Config\Config) {
             $oauthOptions = $oauthOptions->toArray();
         }
         $this->_config->setOptions($oauthOptions);
     }
 }
开发者ID:heiglandreas,项目名称:zf2,代码行数:22,代码来源:Client.php

示例4: __construct

 /**
  * Constructor; creates a new HTTP Client instance which itself is
  * just a typical Zend_HTTP_Client subclass with some OAuth icing to
  * assist in automating OAuth parameter generation, addition and
  * cryptographic signing of requests.
  *
  * @param  array|Traversable $oauthOptions
  * @param  string $uri
  * @param  array|Traversable $options
  */
 public function __construct($oauthOptions, $uri = null, $config = null)
 {
     parent::__construct($uri, $config);
     $this->_config = new Config\StandardConfig();
     if ($oauthOptions !== null) {
         if ($oauthOptions instanceof Traversable) {
             $oauthOptions = ArrayUtils::iteratorToArray($oauthOptions);
         }
         $this->_config->setOptions($oauthOptions);
     }
 }
开发者ID:robertodormepoco,项目名称:zf2,代码行数:21,代码来源:Client.php

示例5: __construct

 /**
  * Constructor
  *
  * @param string            $uri     Target URI
  * @param array|Traversable $options options array (passed to \Zend\Http\Client)
  */
 public function __construct($uri = null, $options = array())
 {
     // If an adapter was not explicitly passed in, set a flag indicating that
     // we need to recheck the proxy settings whenever the request URI is changed
     // (since we need different behavior for localhost vs. proxy)
     if (!isset($options['adapter'])) {
         $this->checkProxy = true;
     }
     // Set up the configuration with the parent class; this will in turn call
     // our overridden setUri() method and configure the adapter if $uri is set.
     parent::__construct($uri, $options);
 }
开发者ID:no-reply,项目名称:cbpl-vufind,代码行数:18,代码来源:Client.php

示例6: __construct

 public function __construct()
 {
     parent::__construct();
     $this->registry = Registry::getInstance();
 }
开发者ID:sudevva,项目名称:parser2,代码行数:5,代码来源:BasePageLoader.php


注:本文中的Zend\Http\Client::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。