This commit is contained in:
Ema Panz 2018-03-29 22:08:02 +00:00 committed by GitHub
commit 47abf173af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -407,7 +407,9 @@ class Runtime
$process = new Process($cmd);
$process->setTimeout($timeout);
$process->run();
$process->run(function($type, $buffer) {
$this->runLocalCommandCallback($type, $buffer);
});
$this->log($process->getOutput(), LogLevel::DEBUG);
if (!$process->isSuccessful()) {
@ -417,6 +419,21 @@ class Runtime
return $process;
}
/**
* Log the output produced by the Process execution
*
* @param string $type
* @param string $buffer
*/
protected function runLocalCommandCallback($type, $buffer)
{
if (Process::OUT === $type) {
$this->log($buffer, LogLevel::DEBUG);
} else {
$this->log($buffer, LogLevel::ERROR);
}
}
/**
* Executes a command remotely, if jail is true, it will run inside the Host Path and the Release (if available)
*