Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Class for connecting to the Amazon Simple Queue Service (SQS)
CREATE_TIMEOUT_DEFAULT = '30'
Default timeout for createQueue() function
$_sqsApiVersion = '2009-02-01'
The API version to use
$_sqsEndpoint = 'queue.amazonaws.com'
HTTP end point for the Amazon SQS service
$_sqsSignatureMethod = 'HmacSHA256'
Signature Encoding Method
$_sqsSignatureVersion = '2'
Signature Version
__construct(
string $accessKey
=
null, string $secretKey
=
null, string $region
=
null
)
:
Constructor
_makeRequest(
$queue_url, string $action, array $params
=
array
)
:
SimpleXMLElement
Make a request to Amazon SQS
_signParameters(
string $queue_url, $paramaters
)
:
string
Computes the RFC 2104-compliant HMAC signature for request parameters
This implements the Amazon Web Services signature, as per the following specification:
Sort all request parameters (including SignatureVersion and excluding Signature, the value of which is being created), ignoring case.
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.
addRequiredParameters(
string $queue_url, array $parameters
)
:
array
Adds required authentication and version parameters to an array of parameters
The required parameters are: - AWSAccessKey - SignatureVersion - Timestamp - Version and - Signature
If a required parameter is already set in the $parameters array, it is overwritten.
count(
string $queue_url
)
:
integer
Return the approximate number of messages in the queue
create(
string $queue_name, integer $timeout
=
null
)
:
string|boolean
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.
delete(
string $queue_url
)
:
boolean
Delete a queue and all of it's messages
Returns false if the queue is not found, true if the queue exists
deleteMessage(
string $queue_url, string $handle
)
:
boolean
Delete a message from the queue
Returns true if the message is deleted, false if the deletion is unsuccessful.
getAttribute(
string $queue_url, string $attribute
=
All
)
:
string
Get the attributes for the queue
getQueues(
)
:
array
Get an array of all available queues
receive(
string $queue_url, integer $max_messages
=
null, integer $timeout
=
null
)
:
array
Get messages in the queue
send(
string $queue_url, string $message
)
:
string
Send a message to the queue