Skip to content
This repository was archived by the owner on Mar 9, 2024. It is now read-only.

Commit c3673f7

Browse files
committed
Use Symfony Process
See #30
1 parent fa71061 commit c3673f7

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

composer.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
],
1212
"require": {
1313
"php": ">=5.3.0",
14-
"illuminate/support": "4.x|5.0.x",
15-
"illuminate/console": "4.x|5.0.x"
14+
"illuminate/support": "4.x",
15+
"illuminate/console": "4.x",
16+
"symfony/process": "~2.3"
1617
},
1718
"autoload": {
1819
"classmap": [

src/AsyncQueue.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
use Barryvdh\Queue\Models\Job;
55
use Illuminate\Queue\SyncQueue;
6+
use Symfony\Component\Process\Process;
67

78
class AsyncQueue extends SyncQueue
89
{
@@ -68,8 +69,11 @@ public function storeJob($job, $data, $delay = 0)
6869
*/
6970
public function startProcess($jobId, $delay = 0)
7071
{
71-
chdir($this->container['path.base']);
72-
exec($this->getCommand($jobId, $delay));
72+
$command = $this->getCommand($jobId, $delay);
73+
$cwd = $this->container['path.base'];
74+
75+
$process = new Process($command, $cwd);
76+
$process->run();
7377
}
7478

7579
/**

0 commit comments

Comments
 (0)