API Documentation

Service/Amazon/Sqs.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Service
subpackage
Amazon_Sqs
version
$Id: Sqs.php 21323 2010-03-04 18:27:32Z stas $
Classes
Zend_Service_Amazon_Sqs

Description

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.

Zend_Service_Amazon_Sqs

Extends from
Zend_Service_Amazon_Abstract
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Service
see
http://aws.amazon.com/sqs/ Amazon Simple Queue Service
subpackage
Amazon_Sqs
Constants
CREATE_TIMEOUT_DEFAULT
Properties
$_sqsEndpoint
$_sqsApiVersion
$_sqsSignatureVersion
$_sqsSignatureMethod
Methods
__construct
create
delete
getQueues
count
send
receive
deleteMessage
getAttribute
_makeRequest
addRequiredParameters
_signParameters

Description

Class for connecting to the Amazon Simple Queue Service (SQS)

Constants

CREATE_TIMEOUT_DEFAULT

 CREATE_TIMEOUT_DEFAULT = '30'

Default timeout for createQueue() function

Details

value
30

Properties

$_sqsApiVersion

 $_sqsApiVersion = '2009-02-01'

The API version to use

Details

visibility
protected
default
2009-02-01
final
false
static
false

$_sqsEndpoint

 $_sqsEndpoint = 'queue.amazonaws.com'

HTTP end point for the Amazon SQS service

Details

visibility
protected
default
queue.amazonaws.com
final
false
static
false

$_sqsSignatureMethod

 $_sqsSignatureMethod = 'HmacSHA256'

Signature Encoding Method

Details

visibility
protected
default
HmacSHA256
final
false
static
false

$_sqsSignatureVersion

 $_sqsSignatureVersion = '2'

Signature Version

Details

visibility
protected
default
2
final
false
static
false

Methods

__construct

__construct( string $accessKey = null, string $secretKey = null, string $region = null ) :

Constructor

Arguments
$accessKey
string
$secretKey
string
$region
string
Details
visibility
public
final
false
static
false

_makeRequest

_makeRequest(  $queue_url, string $action, array $params = array ) : SimpleXMLElement

Make a request to Amazon SQS

Arguments
$queue_url
$action
string
SQS action
$params
array
Output
SimpleXMLElement
Details
visibility
private
final
false
static
false

_signParameters

_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:

  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.

Arguments
$queue_url
string
Queue URL
$paramaters
Output
string
the signed data.
Details
visibility
protected
final
false
static
false

addRequiredParameters

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.

Arguments
$queue_url
string
Queue URL
$parameters
array
the array to which to add the required parameters.
Output
array
Details
visibility
protected
final
false
static
false

count

count( string $queue_url ) : integer

Return the approximate number of messages in the queue

Arguments
$queue_url
string
Queue URL
Output
integer
Details
visibility
public
final
false
static
false
throws

create

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.

Arguments
$queue_name
string
queue name
$timeout
integer
default visibility timeout
Output
string|boolean
Details
visibility
public
final
false
static
false
throws

delete

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

Arguments
$queue_url
string
queue URL
Output
boolean
Details
visibility
public
final
false
static
false
throws

deleteMessage

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.

Arguments
$queue_url
string
Queue URL
$handle
string
Message handle as returned by SQS
Output
boolean
Details
visibility
public
final
false
static
false
throws

getAttribute

getAttribute( string $queue_url, string $attribute = All ) : string

Get the attributes for the queue

Arguments
$queue_url
string
Queue URL
$attribute
string
Output
string
Details
visibility
public
final
false
static
false
throws

getQueues

getQueues( ) : array

Get an array of all available queues

Output
array
Details
visibility
public
final
false
static
false
throws

receive

receive( string $queue_url, integer $max_messages = null, integer $timeout = null ) : array

Get messages in the queue

Arguments
$queue_url
string
Queue name
$max_messages
integer
Maximum number of messages to return
$timeout
integer
Visibility timeout for these messages
Output
array
Details
visibility
public
final
false
static
false
throws

send

send( string $queue_url, string $message ) : string

Send a message to the queue

Arguments
$queue_url
string
Queue URL
$message
string
Message to send to the queue
Output
string
Message ID
Details
visibility
public
final
false
static
false
throws
Documentation was generated by DocBlox.