src/Extractor/Util/ProcessExecutor.php
public function execute($command, &$output = null, $cwd = null)
    {
        // make sure that null translate to the proper directory in case the dir is a symlink
        // and we call a git command, because msysgit does not handle symlinks properly
        if (null === $cwd && defined('PHP_WINDOWS_VERSION_BUILD') && false !== strpos($command, 'git') && getcwd()) {
            $cwd = realpath(getcwd());
        }

        $this->captureOutput = count(func_get_args()) > 1;
        $this->errorOutput = null;
        $process = new Process($command, $cwd, null, null, static::getTimeout());

        $callback = is_callable($output) ? $output : array($this, 'outputHandler');
        $process->run($callback);

        if ($this->captureOutput && !is_callable($output)) {
            $output = $process->getOutput();
        }

        $this->errorOutput = $process->getErrorOutput();

        return $process->getExitCode();
    }
public function execute($command, &$output = null, $cwd = null)
    {
        // make sure that null translate to the proper directory in case the dir is a symlink
        // and we call a git command, because msysgit does not handle symlinks properly
        if (null === $cwd && defined('PHP_WINDOWS_VERSION_BUILD') && false !== strpos($command, 'git') && getcwd()) {
            $cwd = realpath(getcwd());
        }

        $this->captureOutput = count(func_get_args()) > 1;
        $this->errorOutput = null;
        $process = new Process($command, $cwd, null, null, static::getTimeout());

        $callback = is_callable($output) ? $output : array($this, 'outputHandler');
        $process->run($callback);

        if ($this->captureOutput && !is_callable($output)) {
            $output = $process->getOutput();
        }

        $this->errorOutput = $process->getErrorOutput();

        return $process->getExitCode();
    }
public function execute ( $ command , & $ output = null , $ cwd = null ) { // make sure that null translate to the proper directory in case the dir is a symlink // and we call a git command, because msysgit does not handle symlinks properly if ( null === $ cwd && defined ( 'PHP_WINDOWS_VERSION_BUILD' ) && false !== strpos ( $ command , 'git' ) && getcwd ( ) ) { $ cwd = realpath ( getcwd ( ) ) ; } $ this -> captureOutput = count ( func_get_args ( ) ) > 1 ; $ this -> errorOutput = null ; $ process = new Process ( $ command , $ cwd , null , null , static :: getTimeout ( ) ) ; $ callback = is_callable ( $ output ) ? $ output : array ( $ this , 'outputHandler' ) ; $ process -> run ( $ callback ) ; if ( $ this -> captureOutput && ! is_callable ( $ output ) ) { $ output = $ process -> getOutput ( ) ; } $ this -> errorOutput = $ process -> getErrorOutput ( ) ; return $ process -> getExitCode ( ) ; }
runs a process on the commandline

@param  string $command the command to execute
@param  mixed  $output  the output will be written into this var if passed by ref
if a callable is passed it will be used as output handler
@param  string $cwd     the working directory
@return int    statuscode
runs a process on the commandline