PHP Class SimpleEmailServiceRequest

显示文件 Open project: daniel-zahariev/php-aws-ses Class Usage Examples

Public Properties

Property Type Description
$curlOptions

Protected Properties

Property Type Description
$curl_handler CURL request handler that can be reused
$response Holds the response from calling AWS's API

Public Methods

Method Description
__construct ( string $ses, string $verb = 'GET' ) : void Constructor
__destruct ( ) Destroy any leftover handlers
clearParameters ( ) : SimpleEmailServiceRequest Clear the request parameters
getParametersEncoded ( ) : array Get the params for the reques
getResponse ( ) : object | false Get the response
setParameter ( string $key, string $value, boolean $replace = true ) : SimpleEmailServiceRequest Set request parameter
setVerb ( $verb ) : SimpleEmailServiceRequest Set HTTP method

Protected Methods

Method Description
getCurlHandler ( ) : resource Instantiate and setup CURL handler for sending requests.

Private Methods

Method Description
__customUrlEncode ( string $var ) : string Contributed by afx114 URL encode the parameters as per http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/index.html?Query_QueryAuth.html PHP's rawurlencode() follows RFC 1738, not RFC 3986 as required by Amazon. The only difference is the tilde (~), so convert it back after rawurlencode See: http://www.morganney.com/blog/API/AWS-Product-Advertising-API-Requires-a-Signed-Request.php
__getSignature ( string $string ) : string Generate the auth string using Hmac-SHA256
__responseWriteCallback ( resource &$curl, string &$data ) : integer CURL write callback

Method Details

__construct() public method

Constructor
public __construct ( string $ses, string $verb = 'GET' ) : void
$ses string The SimpleEmailService object making this request
$verb string HTTP verb
return void

__destruct() public method

Destroy any leftover handlers
public __destruct ( )

clearParameters() public method

Clear the request parameters
public clearParameters ( ) : SimpleEmailServiceRequest
return SimpleEmailServiceRequest $this

getCurlHandler() protected method

Instance is cashed in $this->curl_handler
protected getCurlHandler ( ) : resource
return resource $curl_handler

getParametersEncoded() public method

Get the params for the reques
public getParametersEncoded ( ) : array
return array $params

getResponse() public method

Get the response
public getResponse ( ) : object | false
return object | false | false

setParameter() public method

Set request parameter
public setParameter ( string $key, string $value, boolean $replace = true ) : SimpleEmailServiceRequest
$key string Key
$value string Value
$replace boolean Whether to replace the key if it already exists (default true)
return SimpleEmailServiceRequest $this

setVerb() public method

Set HTTP method
public setVerb ( $verb ) : SimpleEmailServiceRequest
return SimpleEmailServiceRequest $this

Property Details

$curlOptions public_oe static_oe property

public static $curlOptions

$curl_handler protected_oe property

CURL request handler that can be reused
protected $curl_handler

$response protected_oe property

Holds the response from calling AWS's API
protected $response