mirror of
https://github.com/deployphp/deployer.git
synced 2025-02-24 01:02:24 +01:00
Add checks for fromShellCommandline method
This commit is contained in:
parent
f968f366bc
commit
d9c744808e
@ -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);
|
||||
|
@ -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'])
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user