Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.0] Fix deprecated process calls #515

Merged
merged 1 commit into from
Feb 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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