Gitonomy\Git\Repository::shell PHP Method

shell() public method

Executes a shell command on the repository, using PHP pipes.
public shell ( string $command, array $env = [] )
$command string The command to execute
$env array
    public function shell($command, array $env = array())
    {
        $argument = sprintf('%s \'%s\'', $command, $this->gitDir);
        $prefix = '';
        foreach ($env as $name => $value) {
            $prefix .= sprintf('export %s=%s;', escapeshellarg($name), escapeshellarg($value));
        }
        proc_open($prefix . 'git shell -c ' . escapeshellarg($argument), array(STDIN, STDOUT, STDERR), $pipes);
    }