本文整理汇总了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();
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例6: __construct
public function __construct()
{
parent::__construct();
$this->registry = Registry::getInstance();
}