From f7eac3b5e7696c0f7c78750a2b9a5f63d4102e48 Mon Sep 17 00:00:00 2001 From: warezthebeef Date: Thu, 21 Jul 2011 15:49:18 +1200 Subject: [PATCH 1/2] Added wrapping array() to args to improve compatibility with ruby resque --- lib/Resque/Job.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Resque/Job.php b/lib/Resque/Job.php index 9d674f5..c820412 100644 --- a/lib/Resque/Job.php +++ b/lib/Resque/Job.php @@ -63,7 +63,7 @@ class Resque_Job $id = md5(uniqid('', true)); Resque::push($queue, array( 'class' => $class, - 'args' => $args, + 'args' => array($args), 'id' => $id, )); @@ -128,7 +128,7 @@ class Resque_Job return array(); } - return $this->payload['args']; + return array_shift($this->payload['args']); } /** @@ -248,4 +248,4 @@ class Resque_Job return '(' . implode(' | ', $name) . ')'; } } -?> \ No newline at end of file +?> From 0cfb2d20190a501ec84c7308678d627a2bc16558 Mon Sep 17 00:00:00 2001 From: warezthebeef Date: Fri, 19 Aug 2011 12:33:05 +1200 Subject: [PATCH 2/2] Fixed job arguments being wiped by array_shift --- lib/Resque/Job.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Resque/Job.php b/lib/Resque/Job.php index c820412..ee4aaba 100644 --- a/lib/Resque/Job.php +++ b/lib/Resque/Job.php @@ -128,7 +128,7 @@ class Resque_Job return array(); } - return array_shift($this->payload['args']); + return $this->payload['args'][0]; } /**