Beispiel #1
0
 /**
  * Screen shortcut
  *
  * @return Screen
  */
 protected function screen()
 {
     if ($this->screen === null) {
         $this->screen = Screen::instance();
     }
     return $this->screen;
 }
Beispiel #2
0
 public function __construct(App $app, $moduleName, $commandName, $actionName, $initialize = true)
 {
     $this->app = $app;
     $this->moduleName = $moduleName;
     $this->commandName = $commandName;
     $this->actionName = $actionName;
     $this->params = $app->getParams();
     $this->screen = Screen::instance($app);
     $this->trace = $this->params->shift('trace', false);
     $this->isVerbose = $this->params->shift('verbose', false);
     $this->isDebuging = $this->params->shift('debug', false);
     if ($initialize) {
         $this->init();
     }
 }
Beispiel #3
0
 protected function dispatchEndless()
 {
     $loader = $this->cliLoader();
     $loader->parseParams();
     $screen = Screen::instance();
     while (true) {
         Benchmark::measure('Watch mode - loop begins');
         ob_start();
         $params = clone $this->params;
         $loader->dispatch($params);
         Benchmark::measure('Dispatch done');
         if ($this->showBenchmark) {
             Benchmark::dump();
         }
         Benchmark::reset();
         $out = ob_get_contents();
         ob_end_clean();
         echo $screen->clear() . $out;
         sleep($this->watchTimeout);
     }
 }