public function run()
    {
        if ('cli' != php_sapi_name()) {
            throw new Exception('This has to be run from the command line');
        }

        $this->setup($this->options);
        $this->registerDefaultOptions();
        $this->parseOptions();
        $this->handleDefaultOptions();
        $this->setupLogging();
        $this->checkArgments();
        $this->execute();

        exit(0);
    }
public function run()
    {
        if ('cli' != php_sapi_name()) {
            throw new Exception('This has to be run from the command line');
        }

        $this->setup($this->options);
        $this->registerDefaultOptions();
        $this->parseOptions();
        $this->handleDefaultOptions();
        $this->setupLogging();
        $this->checkArgments();
        $this->execute();

        exit(0);
    }
public function run ( ) { if ( 'cli' != php_sapi_name ( ) ) { throw new Exception ( 'This has to be run from the command line' ) ; } $ this -> setup ( $ this -> options ) ; $ this -> registerDefaultOptions ( ) ; $ this -> parseOptions ( ) ; $ this -> handleDefaultOptions ( ) ; $ this -> setupLogging ( ) ; $ this -> checkArgments ( ) ; $ this -> execute ( ) ; exit ( 0 ) ; }
Execute the CLI program

Executes the setup() routine, adds default options, initiate the options parsing and argument checking
and finally executes main() - Each part is split into their own protected function below, so behaviour
can easily be overwritten

@throws Exception
Execute the CLI program