SimpleShell::execute PHP Method

execute() public method

Does not trap the error stream output as this need PHP 4.3+.
public execute ( string $command ) : integer
$command string The actual command line to run.
return integer Exit code.
    public function execute($command)
    {
        $this->output = false;
        exec($command, $this->output, $ret);
        return $ret;
    }

Usage Example

Example #1
0
 /**
  *    Accessor for the number of subtests.
  *    @return integer       Number of test cases.
  *    @access public
  */
 function getSize() {
     if ($this->_size === false) {
         $shell = new SimpleShell();
         $shell->execute($this->_dry_command);
         $reporter = new SimpleReporter();
         $parser = &$this->_createParser($reporter);
         if (! $parser->parse($shell->getOutput())) {
             trigger_error('Cannot parse incoming XML from [' . $this->_dry_command . ']');
             return false;
         }
         $this->_size = $reporter->getTestCaseCount();
     }
     return $this->_size;
 }
All Usage Examples Of SimpleShell::execute