Пример #1
0
 /**
  * register internal application, register subscribers, fire the event
  */
 public function run()
 {
     $this->registerApplication(new InternalApplication());
     $this->registerSubscribers();
     $input = new Input(new Prompt());
     $calledApp = $input->getOptions()->get(0, InternalApplication::EVENT_HELP);
     $event = new ConsoleEvent($calledApp);
     $event->setInput($input);
     $event->setOutput(new Output(new Printer()));
     $event->setApplications($this->applications);
     $this->eventDispatcher->fire($calledApp, $event);
 }
Пример #2
0
 /**
  * @param ConsoleEvent $event
  */
 public function about(ConsoleEvent $event)
 {
     $output = $event->getOutput();
     $input = $event->getInput();
     $name = $input->read("Your name: ");
     $output->writeln("Nice to meet you " . $name . "!");
     $confirm = $input->confirm("Do you like abdulklara console?");
     if ($confirm === true) {
         $output->success("YAY!");
         $this->terminate();
     }
     $output->error("404");
     $this->terminate();
 }