本文整理汇总了PHP中Zend_Http_Client::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Http_Client::__construct方法的具体用法?PHP Zend_Http_Client::__construct怎么用?PHP Zend_Http_Client::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Http_Client
的用法示例。
在下文中一共展示了Zend_Http_Client::__construct方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructs Object with Server URL and Configs
*
* @param array
*/
public function __construct($array = false)
{
if ($array != false) {
$this->setTestMode($array[0]);
}
parent::__construct($this->getServerUrl(), $this->getConfig());
}
示例2: __construct
/**
* the constructor
*
* @param string $_uri the url to connect to
* @param array $_config see Zend_Http_Client for details
*/
public function __construct($_baseUri, array $_config = array())
{
$this->_baseUri = $_baseUri;
$_config['useragent'] = 'PHP ajam remote client (rev: 0.2)';
$_config['keepalive'] = TRUE;
parent::__construct($_baseUri, $_config);
// enable cookie handling
$this->setCookieJar();
}
示例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
* @return void
*/
public function __construct(array $oauthOptions, $uri = null, $config = null)
{
parent::__construct($uri, $config);
$this->_config = new Zend_Oauth_Config();
if (!is_null($oauthOptions)) {
if ($oauthOptions instanceof Zend_Config) {
$oauthOptions = $oauthOptions->toArray();
}
$this->_config->setOptions($oauthOptions);
}
}
示例4:
function __construct($username = null, $password = null)
{
parent::__construct();
//magic headers for kinopoisk
$this->setHeaders("Host", "www.kinopoisk.ru:80");
$this->setHeaders("Accept", "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg");
$config['maxredirects'] = 5;
$config['timeout'] = 300;
$config['useragent'] = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7 FirePHP/0.4';
$this->setConfig($config);
}
示例5: __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
* @return void
*/
public function __construct($oauthOptions, $uri = null, $config = null)
{
if (!isset($config['rfc3986_strict'])) {
$config['rfc3986_strict'] = true;
}
parent::__construct($uri, $config);
$this->_config = new Zend_Oauth_Config();
if ($oauthOptions !== null) {
if ($oauthOptions instanceof Zend_Config) {
$oauthOptions = $oauthOptions->toArray();
}
$this->_config->setOptions($oauthOptions);
}
}
示例6: __construct
/**
* Constructor method
*
* Expects a configuration parameter.
*
* @param Enlight_Config $config
*/
public function __construct($config)
{
if (!empty($config->paypalSandbox)) {
$url = self::URL_SANDBOX;
} else {
$url = self::URL_LIVE;
}
$this->apiUsername = $config->get('paypalUsername');
$this->apiPassword = $config->get('paypalPassword');
$this->apiSignature = $config->get('paypalSignature');
$this->apiVersion = $config->get('paypalVersion');
parent::__construct($url);
$this->setAdapter(RestClient::createAdapterFromConfig($config));
}
示例7: __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|Zend_Config $oauthOptions
* @param string $uri
* @param array|Zend_Config $config
* @return void
*/
public function __construct($oauthOptions, $uri = null, $config = null)
{
if ($config instanceof Zend_Config && !isset($config->rfc3986_strict)) {
$config = $config->toArray();
$config['rfc3986_strict'] = true;
} else if (null === $config ||
(is_array($config) && !isset($config['rfc3986_strict']))) {
$config['rfc3986_strict'] = true;
}
parent::__construct($uri, $config);
$this->_config = new Zend_Oauth_Config;
if ($oauthOptions !== null) {
if ($oauthOptions instanceof Zend_Config) {
$oauthOptions = $oauthOptions->toArray();
}
$this->_config->setOptions($oauthOptions);
}
}
示例8: __construct
public function __construct($uri = null, $config = null)
{
$this->config['useragent'] = 'Varien_Http_Client';
parent::__construct($uri, $config);
}
示例9: __construct
/**
* コンストラクタ
*
* @param Zend_Uri_Http|string $uri
* @param array $config Configuration key-value pairs.
*/
public function __construct($uri = null, $config = null)
{
parent::__construct($uri, $config);
}
示例10: __construct
/**
* Constructor method
*
* Expects a configuration parameter.
*
* @param Enlight_Config $config
*/
public function __construct($config)
{
if(!empty($config->paypalSandbox)) {
$url = self::URL_SANDBOX;
} else {
$url = self::URL_LIVE;
}
$this->apiUsername = $config->get('paypalUsername');
$this->apiPassword = $config->get('paypalPassword');
$this->apiSignature = $config->get('paypalSignature');
$this->apiVersion = $config->get('paypalVersion');
parent::__construct($url, array(
'useragent' => 'Shopware/' . Shopware()->Config()->Version,
'timeout' => 5,
));
if (extension_loaded('curl')) {
$adapter = new Zend_Http_Client_Adapter_Curl();
$adapter->setCurlOption(CURLOPT_SSL_VERIFYPEER, false);
$adapter->setCurlOption(CURLOPT_SSL_VERIFYHOST, false);
$this->setAdapter($adapter);
}
}
示例11: __construct
/**
* Constructor method
*
* Expects a configuration parameter.
*
* @param Enlight_Config $config
*/
public function __construct($config)
{
$this->pluginConfig = $config;
parent::__construct($this->getBaseUri());
$this->setAdapter(self::createAdapterFromConfig($config));
}
示例12: __construct
public function __construct($baseApiUrl)
{
parent::__construct();
$this->_baseApiUrl = $baseApiUrl;
$this->assignApiKey()->assignTenant();
}
示例13: __construct
/**
* Initializes Zend_Http_Client connection.
*
* @param string $base api url
* @param integer $timeout connection timeout
* @param string $useragent client user-agent
*/
public function __construct($base, $timeout = 10, $useragent = 'jirafe-php-client')
{
$this->_base = rtrim($base, '/') . '/';
$config = array('useragent' => $useragent, 'timeout' => $timeout);
parent::__construct($this->_base, $config);
}