Skip to content

Commit

Permalink
Merge pull request #515 from driesvints/fix-deprecated-process-calls
Browse files Browse the repository at this point in the history
[3.0] Fix deprecated process calls
  • Loading branch information
taylorotwell committed Feb 21, 2019
2 parents 374ab3c + 3055cdc commit 4343051
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/MasterSupervisorCommands/AddSupervisor.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected function createProcess(MasterSupervisor $master, SupervisorOptions $op
{
$command = $options->toSupervisorCommand();

return (new Process($command, $options->directory ?? base_path()))
return Process::fromShellCommandline($command, $options->directory ?? base_path())
->setTimeout(null)
->disableOutput();
}
Expand Down
4 changes: 2 additions & 2 deletions src/ProcessPool.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ protected function createProcess()
? BackgroundProcess::class
: Process::class;

return new WorkerProcess((new $class(
$this->options->toWorkerCommand(), $this->options->directory)
return new WorkerProcess($class::fromShellCommandline(
$this->options->toWorkerCommand(), $this->options->directory
)->setTimeout(null)->disableOutput());
}

Expand Down
2 changes: 1 addition & 1 deletion src/SystemProcessCounter.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class SystemProcessCounter
*/
public function get($name)
{
$process = new Process('exec ps aux | grep '.static::$command, null, ['COLUMNS' => '2000']);
$process = Process::fromShellCommandline('exec ps aux | grep '.static::$command, null, ['COLUMNS' => '2000']);

$process->run();

Expand Down
6 changes: 3 additions & 3 deletions tests/Feature/WorkerProcessTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function test_worker_process_fires_event_if_stopped_process_cant_be_resta
{
Event::fake();

$process = new Process('exit 1');
$process = new Process(['exit', 1]);
$workerProcess = new WorkerProcess($process);
$workerProcess->start(function () {
});
Expand All @@ -31,7 +31,7 @@ public function test_process_is_not_restarted_during_cooldown_period()
{
Event::fake();

$process = new Process('exit 1');
$process = new Process(['exit', 1]);
$workerProcess = new WorkerProcess($process);
$workerProcess->start(function () {
});
Expand All @@ -47,7 +47,7 @@ public function test_process_is_restarted_after_cooldown_period()
{
Event::fake();

$process = new Process('exit 1');
$process = new Process(['exit', 1]);
$workerProcess = new WorkerProcess($process);
$workerProcess->start(function () {
});
Expand Down

0 comments on commit 4343051

Please sign in to comment.