From f0a4990105292afb35603395106c4a56a7459c83 Mon Sep 17 00:00:00 2001 From: David Abdemoulaie Date: Fri, 10 Dec 2010 17:30:28 -0800 Subject: [PATCH] Refactors $_ENV to getenv --- resque.php | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/resque.php b/resque.php index 4b7ab44..83b228b 100644 --- a/resque.php +++ b/resque.php @@ -1,43 +1,47 @@ 1) { - $count = $_ENV['COUNT']; +$COUNT = getenv('COUNT'); +if(!empty($COUNT) && $COUNT > 1) { + $count = $COUNT; } if($count > 1) { @@ -48,7 +52,7 @@ if($count > 1) { } // Child, start the worker else if(!$pid) { - $queues = explode(',', $_ENV['QUEUE']); + $queues = explode(',', $QUEUE); $worker = new Resque_Worker($queues); $worker->logLevel = $logLevel; fwrite(STDOUT, '*** Starting worker '.$worker."\n"); @@ -59,10 +63,10 @@ if($count > 1) { } // Start a single worker else { - $queues = explode(',', $_ENV['QUEUE']); + $queues = explode(',', $QUEUE); $worker = new Resque_Worker($queues); $worker->logLevel = $logLevel; fwrite(STDOUT, '*** Starting worker '.$worker."\n"); $worker->work($interval); } -?> \ No newline at end of file +?>