本文整理汇总了PHP中RequestCore::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP RequestCore::__construct方法的具体用法?PHP RequestCore::__construct怎么用?PHP RequestCore::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RequestCore
的用法示例。
在下文中一共展示了RequestCore::__construct方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Method: __construct()
* The constructor
*
* Access:
* public
*
* Parameters:
* $url - _string_ (Optional) The URL to request or service endpoint to query.
* $proxy - _string_ (Optional) The faux-url to use for proxy settings. Takes the following format: `proxy://user:pass@hostname:port`
* $helpers - _array_ (Optional) An associative array of classnames to use for request, and response functionality. Gets passed in automatically by the calling class.
*
* Returns:
* `$this`
*/
public function __construct($url = null, $proxy = null, $helpers = null)
{
parent::__construct($url, $proxy, $helpers);
// Standard settings for all requests
$this->add_header('Expect', '100-continue');
$this->set_useragent(CFRUNTIME_USERAGENT);
return $this;
}
示例2: __construct
/**
* Constructs a new instance of this class.
*
* @param string $url (Optional) The URL to request or service endpoint to query.
* @param string $proxy (Optional) The faux-url to use for proxy settings. Takes the following format: `proxy://user:pass@hostname:port`
* @param array $helpers (Optional) An associative array of classnames to use for request, and response functionality. Gets passed in automatically by the calling class.
* @param CFCredential $credentials (Required) The credentials to use for signing and making requests.
* @return $this A reference to the current instance.
*/
public function __construct($url = null, $proxy = null, $helpers = null, CFCredential $credentials = null)
{
parent::__construct($url, $proxy, $helpers);
// Standard settings for all requests
$this->set_useragent(CFRUNTIME_USERAGENT);
$this->credentials = $credentials;
$this->cacert_location = $this->credentials['certificate_authority'] ? $this->credentials['certificate_authority'] : false;
return $this;
}
示例3: __construct
/**
* Constructs a new instance of this class.
*
* @param string $url (Optional) The URL to request or service endpoint to query.
* @param string $proxy (Optional) The faux-url to use for proxy settings. Takes the following format: `proxy://user:pass@hostname:port`
* @param array $helpers (Optional) An associative array of classnames to use for request, and response functionality. Gets passed in automatically by the calling class.
* @return $this A reference to the current instance.
*/
public function __construct($url = null, $proxy = null, $helpers = null)
{
parent::__construct($url, $proxy, $helpers);
// Standard settings for all requests
$this->add_header('Expect', '100-continue');
$this->set_useragent(CFRUNTIME_USERAGENT);
$this->cacert_location = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' ? true : (defined('AWS_CERTIFICATE_AUTHORITY') ? AWS_CERTIFICATE_AUTHORITY : false);
return $this;
}
示例4: __construct
/**
* Constructs a new instance of this class.
*
* @param string $url (Optional) The URL to request or service endpoint to query.
* @param string $proxy (Optional) The faux-url to use for proxy settings. Takes the following format: `proxy://user:pass@hostname:port`
* @param array $helpers (Optional) An associative array of classnames to use for request, and response functionality. Gets passed in automatically by the calling class.
* @param CFCredential $credentials (Required) The credentials to use for signing and making requests.
* @return $this A reference to the current instance.
*/
public function __construct($url = null, $proxy = null, $helpers = null, CFCredential $credentials = null)
{
parent::__construct($url, $proxy, $helpers);
// Standard settings for all requests
$this->set_useragent(CFRUNTIME_USERAGENT);
$this->credentials = $credentials;
$this->cacert_location = $this->credentials['certificate_authority'] ? $this->credentials['certificate_authority'] : false;
if (strpos(parse_url($url, PHP_URL_HOST), 'dynamodb') === 0) {
$this->use_gzip_enconding = false;
}
return $this;
}