1 | <?php |
||
2 | if(empty($argv[1])) { |
||
3 | die('Specify the name of a job to add. e.g, php queue.php PHP_Job'); |
||
4 | } |
||
5 | |||
6 | require __DIR__ . '/init.php'; |
||
7 | date_default_timezone_set('GMT'); |
||
8 | Resque::setBackend('127.0.0.1:6379'); |
||
9 | |||
10 | // You can also use a DSN-style format: |
||
11 | //Resque::setBackend('redis://user:[email protected]:6379'); |
||
12 | //Resque::setBackend('redis://user:[email protected]:3432/2'); |
||
13 | |||
14 | $args = array( |
||
15 | 'time' => time(), |
||
16 | 'array' => array( |
||
17 | 'test' => 'test', |
||
18 | ), |
||
19 | ); |
||
20 | if (empty($argv[2])) { |
||
21 | $jobId = Resque::enqueue('default', $argv[1], $args, true); |
||
22 | } else { |
||
23 | $jobId = Resque::enqueue($argv[1], $argv[2], $args, true); |
||
24 | } |
||
25 | |||
26 | echo "Queued job ".$jobId."\n\n"; |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
27 |