public function exec($command)
    {
        $this->debug("Executing: $command");
        $output = $returnValue = null;
        exec($command, $output, $returnValue);

        if ($returnValue != 0) {
            throw new \RuntimeException('Error executing command: '
                . $command . ' : ' . implode("\n", $output));
        }

        return implode("\n", $output);
    }
public function exec($command)
    {
        $this->debug("Executing: $command");
        $output = $returnValue = null;
        exec($command, $output, $returnValue);

        if ($returnValue != 0) {
            throw new \RuntimeException('Error executing command: '
                . $command . ' : ' . implode("\n", $output));
        }

        return implode("\n", $output);
    }
public function exec ( $ command ) { $ this -> debug ( "Executing: $command" ) ; $ output = $ returnValue = null ; exec ( $ command , $ output , $ returnValue ) ; if ( $ returnValue != 0 ) { throw new \ RuntimeException ( 'Error executing command: ' . $ command . ' : ' . implode ( "\n" , $ output ) ) ; } return implode ( "\n" , $ output ) ; }
Execute a command and throw an exception if the return code is not 0.

@param string $command Command to execute

@return string Returns the output of the command as a string
@throws \RuntimeException on error.
Execute a command and throw an exception if the return code is not 0 .