/** * {@inheritdoc} */ public function getQueueOptions($queueName) { $response = $this->parseResponse($this->sqs->get_queue_attributes($this->getQueueUrl($queueName), array('AttributeName' => 'All'))); $attributes = array(); foreach ($response->GetQueueAttributesResult->Attribute as $attribute) { $attributes[(string) $attribute->Name] = (string) $attribute->Value; } return $attributes; }
/** * Method: get_queue_attributes() * Identical to <AmazonSQS::get_queue_attributes()>, except that you don't need to pass in a queue URL. * * Access: * public * * Parameters: * returnCurlHandle - See <AmazonSQS::get_queue_attributes()>. * * Returns: * <TarzanHTTPResponse> object * * See Also: * Example Usage - http://tarzan-aws.com/docs/examples/sqsqueue/get_queue_attributes.phps */ public function get_queue_attributes($returnCurlHandle = null) { if ($this->queue_url) { return parent::get_queue_attributes($this->queue_url, $returnCurlHandle); } throw new SQSQueue_Exception(SQSQUEUE_DEFAULT_ERROR); }
<?php require_once '/usr/share/php/AWSSDKforPHP/sdk.class.php'; define('AWS_KEY', 'AKIAIGKECZXA7AEIJLMQ'); define('AWS_SECRET_KEY', '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'); define('AWS_ACCOUNT_ID', '457964863276'); $queue_name = $_GET['queue']; $sqs = new AmazonSQS(); $sqs->set_region($sqs::REGION_EU_W1); $queue = $sqs->create_queue($queue_name); $queue->isOK() or die('could not create queue ' + $queue_name); $response = $sqs->get_queue_attributes($queue->body->QueueUrl(0), array('AttributeName' => 'All')); pr($response->body); function pr($var) { print '<pre>'; print_r($var); print '</pre>'; }