Zend Framework
1.12
|
Public Member Functions | |
__construct ($accessKey=null, $secretKey=null, $region=null) | |
Constructor. | |
setEndpoint ($region) | |
Set SQS endpoint. | |
getEndpoint () | |
Get the SQS endpoint. | |
getEndpoints () | |
Get possible SQS endpoints. | |
create ($queue_name, $timeout=null) | |
Create a new queue. | |
delete ($queue_url) | |
Delete a queue and all of it's messages. | |
getQueues () | |
Get an array of all available queues. | |
count ($queue_url) | |
Return the approximate number of messages in the queue. | |
send ($queue_url, $message) | |
Send a message to the queue. | |
receive ($queue_url, $max_messages=null, $timeout=null) | |
Get messages in the queue. | |
deleteMessage ($queue_url, $handle) | |
Delete a message from the queue. | |
getAttribute ($queue_url, $attribute= 'All') | |
Get the attributes for the queue. | |
![]() | |
__construct ($accessKey=null, $secretKey=null) | |
Create Amazon client. | |
Public Attributes | |
const | CREATE_TIMEOUT_DEFAULT = 30 |
Default timeout for createQueue() function. | |
Protected Member Functions | |
_setEndpoint ($region) | |
Set SQS endpoint. | |
addRequiredParameters ($queue_url, array $parameters) | |
Adds required authentication and version parameters to an array of parameters. | |
_signParameters ($queue_url, array $paramaters) | |
Computes the RFC 2104-compliant HMAC signature for request parameters. | |
![]() | |
_getAccessKey () | |
Method to fetch the Access Key. | |
_getSecretKey () | |
Method to fetch the Secret AWS Key. | |
Protected Attributes | |
$_sqsEndpoint = 'queue.amazonaws.com' | |
HTTP end point for the Amazon SQS service. | |
$_sqsApiVersion = '2009-02-01' | |
The API version to use. | |
$_sqsSignatureVersion = '2' | |
Signature Version. | |
$_sqsSignatureMethod = 'HmacSHA256' | |
Signature Encoding Method. | |
$_sqsEndpoints | |
![]() | |
$_secretKey | |
$_accessKey | |
Additional Inherited Members | |
![]() | |
static | setKeys ($accessKey, $secretKey) |
Set the keys to use when accessing SQS. | |
![]() | |
static | $_defaultAccessKey = null |
static | $_defaultSecretKey = null |
__construct | ( | $accessKey = null , |
|
$secretKey = null , |
|||
$region = null |
|||
) |
Constructor.
The default region is us-east-1. Use the region to set it to one of the regions that is build-in into ZF. To add a new AWS region use the setEndpoint() method.
string | $accessKey | |
string | $secretKey | |
string | $region |
|
protected |
Set SQS endpoint.
Checks and sets endpoint if region exists in $_sqsEndpoints. If a new SQS region is added by amazon, please use the setEndpoint function to set it.
string | $region | region |
Zend_Service_Amazon_Sqs_Exception |
|
protected |
Computes the RFC 2104-compliant HMAC signature for request parameters.
This implements the Amazon Web Services signature, as per the following specification:
1. Sort all request parameters (including SignatureVersion
and excluding Signature
, the value of which is being created), ignoring case.
2. Iterate over the sorted list and append the parameter name (in its original case) and then its value. Do not URL-encode the parameter values before constructing this string. Do not use any separator characters when appending strings.
string | $queue_url | Queue URL |
array | $parameters | the parameters for which to get the signature. |
|
protected |
Adds required authentication and version parameters to an array of parameters.
The required parameters are:
If a required parameter is already set in the $parameters
array, it is overwritten.
string | $queue_url | Queue URL |
array | $parameters | the array to which to add the required parameters. |
count | ( | $queue_url | ) |
Return the approximate number of messages in the queue.
string | $queue_url | Queue URL |
Zend_Service_Amazon_Sqs_Exception |
create | ( | $queue_name, | |
$timeout = null |
|||
) |
Create a new queue.
Visibility timeout is how long a message is left in the queue "invisible" to other readers. If the message is acknowleged (deleted) before the timeout, then the message is deleted. However, if the timeout expires then the message will be made available to other queue readers.
string | $queue_name | queue name |
integer | $timeout | default visibility timeout |
Zend_Service_Amazon_Sqs_Exception |
delete | ( | $queue_url | ) |
Delete a queue and all of it's messages.
Returns false if the queue is not found, true if the queue exists
string | $queue_url | queue URL |
Zend_Service_Amazon_Sqs_Exception |
deleteMessage | ( | $queue_url, | |
$handle | |||
) |
Delete a message from the queue.
Returns true if the message is deleted, false if the deletion is unsuccessful.
string | $queue_url | Queue URL |
string | $handle | Message handle as returned by SQS |
Zend_Service_Amazon_Sqs_Exception |
getAttribute | ( | $queue_url, | |
$attribute = 'All' |
|||
) |
Get the attributes for the queue.
string | $queue_url | Queue URL |
string | $attribute |
Zend_Service_Amazon_Sqs_Exception |
getEndpoint | ( | ) |
Get the SQS endpoint.
getEndpoints | ( | ) |
Get possible SQS endpoints.
Since there is not an SQS webserive to get all possible endpoints, a hardcoded list is available. For the actual region list please check: http://docs.amazonwebservices.com/AWSSimpleQueueService/2009-02-01/APIReference/index.html?QueueServiceWsdlArticle.html
string | $region | region |
getQueues | ( | ) |
receive | ( | $queue_url, | |
$max_messages = null , |
|||
$timeout = null |
|||
) |
Get messages in the queue.
string | $queue_url | Queue name |
integer | $max_messages | Maximum number of messages to return |
integer | $timeout | Visibility timeout for these messages |
Zend_Service_Amazon_Sqs_Exception |
send | ( | $queue_url, | |
$message | |||
) |
Send a message to the queue.
string | $queue_url | Queue URL |
string | $message | Message to send to the queue |
Zend_Service_Amazon_Sqs_Exception |
setEndpoint | ( | $region | ) |
Set SQS endpoint.
You can set SQS to on of the build-in regions. If the region does not exsist it will be added.
string | $region | region |
Zend_Service_Amazon_Sqs_Exception |
|
protected |
The API version to use.
|
protected |
HTTP end point for the Amazon SQS service.
|
protected |
|
protected |
Signature Encoding Method.
|
protected |
Signature Version.
const CREATE_TIMEOUT_DEFAULT = 30 |
Default timeout for createQueue() function.