Download a latest package or use Composer:
composer require czproject/runner
CzProject\Runner
requires PHP 5.6.0 or later.
use CzProject\Runner\Runner;
$runner = new Runner('/path/to/working/directory');
$result = $runner->run('ls');
$result = $runner->run(array('git', 'remote', 'add', $remoteName, $remoteUrl));
$result = $runner->run(array(
'git',
'clone',
$cloneUrl,
'--bare' => TRUE,
'--branch' => 'master',
));
$result->isOk();
$result->getCommand();
$result->getCode();
$result->getOutput();
License: New BSD License
Author: Jan Pecha, https://www.janpecha.cz/