Permalink
Browse files

Added deleteQueue() method; bump version

  • Loading branch information...
1 parent 2de6e27 commit b8d3fb12813e75e479c5a8641d4d0d2aedfa841b @thousandsofthem thousandsofthem committed Mar 7, 2013
Showing with 26 additions and 7 deletions.
  1. +20 −6 IronMQ.class.php
  2. BIN iron_mq.phar
  3. +6 −1 testPushQueues.php
View
@@ -6,7 +6,7 @@
* @link https://github.com/iron-io/iron_mq_php
* @link http://www.iron.io/products/mq
* @link http://dev.iron.io/
- * @version 1.4.2
+ * @version 1.4.3
* @package IronMQPHP
* @copyright Feel free to copy, steal, take credit for, or whatever you feel like doing with this code. ;)
*/
@@ -117,7 +117,7 @@ public function asArray() {
class IronMQ extends IronCore {
- protected $client_version = '1.4.2';
+ protected $client_version = '1.4.3';
protected $client_name = 'iron_mq_php';
protected $product_name = 'iron_mq';
protected $default_values = array(
@@ -397,10 +397,24 @@ public function touchMessage($queue_name, $message_id) {
* @return mixed
*/
public function releaseMessage($queue_name, $message_id) {
- $this->setJsonHeaders();
- $queue = rawurlencode($queue_name);
- $url = "projects/{$this->project_id}/queues/$queue/messages/{$message_id}/release";
- return self::json_decode($this->apiCall(self::POST, $url));
+ $this->setJsonHeaders();
+ $queue = rawurlencode($queue_name);
+ $url = "projects/{$this->project_id}/queues/$queue/messages/{$message_id}/release";
+ return self::json_decode($this->apiCall(self::POST, $url));
+ }
+
+ /**
+ * Delete a Message Queue
+ * This call deletes a message queue and all its messages.
+ *
+ * @param string $queue_name
+ * @return mixed
+ */
+ public function deleteQueue($queue_name) {
+ $this->setJsonHeaders();
+ $queue = rawurlencode($queue_name);
+ $url = "projects/{$this->project_id}/queues/$queue";
+ return self::json_decode($this->apiCall(self::DELETE, $url));
}
/**
View
Binary file not shown.
View
@@ -46,4 +46,9 @@
$res = $ironmq->getQueue($queue_name);
echo "Queue info:\n";
-print_r($res);
+print_r($res);
+
+$res = $ironmq->deleteQueue($queue_name);
+echo "Queue deleted:\n";
+print_r($res);
+

0 comments on commit b8d3fb1

Please sign in to comment.