diff --git a/src/Executor/ParallelExecutor.php b/src/Executor/ParallelExecutor.php index 26795c69..90566985 100644 --- a/src/Executor/ParallelExecutor.php +++ b/src/Executor/ParallelExecutor.php @@ -171,7 +171,11 @@ class ParallelExecutor implements ExecutorInterface } $command = "$dep $file worker $arguments $options --hostname $hostname --task $taskName --config-file $configFile"; - $process = Process::fromShellCommandline($command); + if (method_exists('Symfony\Component\Process\Process', 'fromShellCommandline')) { + $process = Process::fromShellCommandline($command); + } else { + $process = new Process($command); + } if (!defined('DEPLOYER_PARALLEL_PTY')) { $process->setPty(true); diff --git a/src/Utility/ProcessRunner.php b/src/Utility/ProcessRunner.php index 06493e44..f2f14b55 100644 --- a/src/Utility/ProcessRunner.php +++ b/src/Utility/ProcessRunner.php @@ -44,11 +44,12 @@ class ProcessRunner $this->pop->command($hostname, $command); - if (method_exists('Process', 'fromShellCommandline')) { + if (method_exists('Symfony\Component\Process\Process', 'fromShellCommandline')) { $process = Process::fromShellCommandline($command); } else { $process = new Process($command); } + $process ->setTimeout($config['timeout']) ->setTty($config['tty']) diff --git a/test/recipe/tester.php b/test/recipe/tester.php index 9fedd058..d664ea6e 100644 --- a/test/recipe/tester.php +++ b/test/recipe/tester.php @@ -21,7 +21,11 @@ function exec($command) $command = 'cd ' . DepCase::$currentPath . ' && ' . $command; } - $process = Process::fromShellCommandline($command); + if (method_exists('Symfony\Component\Process\Process', 'fromShellCommandline')) { + $process = Process::fromShellCommandline($command); + } else { + $process = new Process($command); + } $process ->mustRun();