Example #1
0
 public function execute($input = null)
 {
     register_shutdown_function(array($this, 'shutdown'));
     set_error_handler(array($this, 'handleError'));
     Config::setOutput(new ConsoleOutput());
     $input = $this->prepareInput($input ? $input : $_SERVER['argv']);
     $app = new Application('Robo', self::VERSION);
     $app->addCommandsFromClass($this->roboClass, $this->passThroughArgs);
     $app->run($input);
 }
Example #2
0
File: Runner.php Project: ak4n/Robo
 public function execute($input = null)
 {
     register_shutdown_function(array($this, 'shutdown'));
     set_error_handler(array($this, 'handleError'));
     Config::setOutput(new ConsoleOutput());
     $input = $this->prepareInput($input ? $input : $_SERVER['argv']);
     $app = new Application('Robo', self::VERSION);
     if (!$this->loadRoboFile()) {
         $this->yell("Robo is not initialized here. Please run `robo init` to create a new RoboFile", 40, 'yellow');
         $app->addInitRoboFileCommand($this->roboFile, $this->roboClass);
         $app->run($input);
         return;
     }
     $app->addCommandsFromClass($this->roboClass, $this->passThroughArgs);
     $app->run($input);
 }
Example #3
0
File: Runner.php Project: jjok/Robo
 /**
  * @param \Robo\Application $app
  * @param string|BuilderAwareInterface|ContainerAwareInterface $commandClass
  *
  * @return mixed|void
  */
 public function registerCommandClass($app, $commandClass)
 {
     $container = Robo::getContainer();
     $roboCommandFileInstance = $this->instantiateCommandClass($commandClass);
     if (!$roboCommandFileInstance) {
         return;
     }
     // Register commands for all of the public methods in the RoboFile.
     $commandFactory = $container->get('commandFactory');
     $commandList = $commandFactory->createCommandsFromClass($roboCommandFileInstance);
     foreach ($commandList as $command) {
         $app->add($command);
     }
     return $roboCommandFileInstance;
 }
Example #4
0
 public function testCommandNaming()
 {
     $this->assertNotNull($this->app->find('generate:user-avatar'));
 }
Example #5
0
 protected function createCommand($name)
 {
     return $this->app->createCommand(new \Robo\TaskInfo(self::ROBOFILE, $name));
 }