Constructs a new instance of this class.
public __construct ( string $url = null, string $proxy = null, array $helpers = null ) | ||
$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. |
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }