|
|
@ -62,7 +62,13 @@ class ProcessExecutor
|
|
|
|
|
|
|
|
|
|
|
|
$this->captureOutput = func_num_args() > 1;
|
|
|
|
$this->captureOutput = func_num_args() > 1;
|
|
|
|
$this->errorOutput = null;
|
|
|
|
$this->errorOutput = null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// TODO in v3, commands should be passed in as arrays of cmd + args
|
|
|
|
|
|
|
|
if (method_exists('Symfony\Component\Process\Process', 'fromShellCommandline')) {
|
|
|
|
|
|
|
|
$process = Process::fromShellCommandline($command, $cwd, null, null, static::getTimeout());
|
|
|
|
|
|
|
|
} else {
|
|
|
|
$process = new Process($command, $cwd, null, null, static::getTimeout());
|
|
|
|
$process = new Process($command, $cwd, null, null, static::getTimeout());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$callback = is_callable($output) ? $output : array($this, 'outputHandler');
|
|
|
|
$callback = is_callable($output) ? $output : array($this, 'outputHandler');
|
|
|
|
$process->run($callback);
|
|
|
|
$process->run($callback);
|
|
|
|