public function run($input = null)
    {
        $callback = $this->getCallback();

        ob_start();

        $exitCode = $callback($input);

        $output = ob_get_contents();

        ob_end_clean();

        // Run the piped command, if any
        if ($this->hasPipedCommand()) {
            $pipedCommand = $this->getPipedCommand();

            $pipedCommand->run($output);

            $output      = $pipedCommand->getOutput();
            $exitCode    = $pipedCommand->getExitCode();
            $errorOutput = $pipedCommand->getErrorOutput();
        }

        $this->_output = $output;
        $this->_exitCode = $exitCode;

        return $this;
    }
public function run($input = null)
    {
        $callback = $this->getCallback();

        ob_start();

        $exitCode = $callback($input);

        $output = ob_get_contents();

        ob_end_clean();

        // Run the piped command, if any
        if ($this->hasPipedCommand()) {
            $pipedCommand = $this->getPipedCommand();

            $pipedCommand->run($output);

            $output      = $pipedCommand->getOutput();
            $exitCode    = $pipedCommand->getExitCode();
            $errorOutput = $pipedCommand->getErrorOutput();
        }

        $this->_output = $output;
        $this->_exitCode = $exitCode;

        return $this;
    }
public function run ( $ input = null ) { $ callback = $ this -> getCallback ( ) ; ob_start ( ) ; $ exitCode = $ callback ( $ input ) ; $ output = ob_get_contents ( ) ; ob_end_clean ( ) ; // Run the piped command, if any if ( $ this -> hasPipedCommand ( ) ) { $ pipedCommand = $ this -> getPipedCommand ( ) ; $ pipedCommand -> run ( $ output ) ; $ output = $ pipedCommand -> getOutput ( ) ; $ exitCode = $ pipedCommand -> getExitCode ( ) ; $ errorOutput = $ pipedCommand -> getErrorOutput ( ) ; } $ this -> _output = $ output ; $ this -> _exitCode = $ exitCode ; return $ this ; }
Run this command and get the exit code for it.

@param string $input (Optional) input string for this command.

@return \Clinner\Command\CommandInterface This command, for a fluent API.
Run this command and get the exit code for it .