Possible override of runLocally task with timeout parameter optional.

This commit is contained in:
Andreas Ek 2015-02-17 20:41:16 +01:00
parent 65d7f416a5
commit a2ffc2259d

View File

@ -207,12 +207,14 @@ function run($command)
/**
* Execute commands on local machine.
* @param string $command Command to run locally.
* @param int $timeout (optional) Override process command timeout in seconds.
* @return string Output of command.
* @throws \RuntimeException
*/
function runLocally($command)
function runLocally($command, $timeout=60)
{
$process = new Symfony\Component\Process\Process($command);
$process->setTimeout( $timeout );
$process->run();
if (!$process->isSuccessful()) {