/**
  * @return \Symfony\Component\Console\Helper\DialogHelper
  */
 public function getDialogHelper()
 {
     $dialog = new \Symfony\Component\Console\Helper\DialogHelper();
     $helperSet = new HelperSet(array(new FormatterHelper()));
     $dialog->setHelperSet($helperSet);
     $dialog->setInputStream($this->getInputStream());
     return $dialog;
 }
示例#2
0
文件: Runner.php 项目: gourmet/robo
 protected function loadRoboFile()
 {
     if (!file_exists($this->file)) {
         $this->output->writeln(sprintf('<comment>%s could not be found</comment>', $this->file));
         $dialog = new \Symfony\Component\Console\Helper\DialogHelper();
         if ($dialog->askConfirmation($this->output, sprintf("<question>Should I create %s? (y/n)</question> ", $this->file), false)) {
             $this->initRoboFile();
         }
         exit;
     }
     require_once $this->file;
     if (!class_exists(self::ROBOCLASS)) {
         $this->output->writeln("<error>Class " . self::ROBOCLASS . " was not loaded</error>");
         return false;
     }
     return true;
 }