Skip to content

Commit aca8346

Browse files
committed
Use Symfony Process
See barryvdh#30
1 parent 1439bc7 commit aca8346

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"require": {
1313
"php": ">=5.4.0",
1414
"illuminate/support": "5.0.x",
15-
"illuminate/console": "5.0.x"
15+
"illuminate/console": "5.0.x",
16+
"symfony/process": "~2.6"
1617
},
1718
"autoload": {
1819
"psr-4": {

src/AsyncQueue.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
use Illuminate\Database\Connection;
55
use Illuminate\Queue\DatabaseQueue;
66
use Illuminate\Queue\Jobs\DatabaseJob;
7+
use Symfony\Component\Process\Process;
78

89
class AsyncQueue extends DatabaseQueue
910
{
@@ -134,8 +135,11 @@ public function getJobFromId($queue, $id)
134135
*/
135136
public function startProcess($queue, $id)
136137
{
137-
chdir($this->container['path.base']);
138-
exec($this->getCommand($queue, $id));
138+
$command = $this->getCommand($queue, $id);
139+
$cwd = base_path();
140+
141+
$process = new Process($command, $cwd);
142+
$process->run();
139143
}
140144

141145
/**

0 commit comments

Comments
 (0)