/**
  * Initializes the application by creating the command runner.
  */
 protected function init()
 {
     parent::init();
     if (!isset($_SERVER['argv'])) {
         // || strncasecmp(php_sapi_name(),'cli',3))
         die('This script must be run from the command line.');
     }
     $this->_runner = $this->createCommandRunner();
     $this->_runner->commands = $this->commandMap;
     $this->_runner->addCommands($this->getCommandPath());
 }
Example #2
0
 /**
  * Initializes the application.
  * This method overrides the parent implementation by preloading the 'request' component.
  */
 protected function init()
 {
     parent::init();
     // preload 'request' so that it has chance to respond to onBeginRequest event.
     $this->getRequest();
 }