output() 공개 정적인 메소드

Return the output object.
public static output ( ) : Symfony\Component\Console\Output\OutputInterface
리턴 Symfony\Component\Console\Output\OutputInterface
예제 #1
0
파일: Application.php 프로젝트: jjok/Robo
 /**
  * @param string $roboFile
  * @param string $roboClass
  */
 public function addInitRoboFileCommand($roboFile, $roboClass)
 {
     $createRoboFile = new Command('init');
     $createRoboFile->setDescription("Intitalizes basic RoboFile in current dir");
     $createRoboFile->setCode(function () use($roboClass, $roboFile) {
         $output = Robo::output();
         $output->writeln("<comment>  ~~~ Welcome to Robo! ~~~~ </comment>");
         $output->writeln("<comment>  " . basename($roboFile) . " will be created in the current directory </comment>");
         file_put_contents($roboFile, '<?php' . "\n/**" . "\n * This is project's console commands configuration for Robo task runner." . "\n *" . "\n * @see http://robo.li/" . "\n */" . "\nclass " . $roboClass . " extends \\Robo\\Tasks\n{\n    // define public methods as commands\n}");
         $output->writeln("<comment>  Edit this file to add your commands! </comment>");
     });
     $this->add($createRoboFile);
 }
예제 #2
0
 protected function registerRoboFileCommands($app)
 {
     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(Robo::input(), Robo::output());
         return;
     }
     $this->registerCommandClasses($app, $this->roboClass);
 }
예제 #3
0
 public function testTasksStopOnFail()
 {
     $argv = ['placeholder', 'test:stop-on-fail'];
     $result = $this->runner->execute($argv, Robo::output());
     $this->guy->seeInOutput('[');
     $this->assertTrue($result > 0);
 }
예제 #4
0
 /**
  * {@inheritdoc}
  */
 public function run()
 {
     $this->printTaskInfo('Running command {command}', ['command' => $this->command->getName()]);
     return new Result($this, $this->command->run(new ArrayInput($this->input), Robo::output()));
 }