コード例 #1
0
ファイル: Loader.php プロジェクト: hsanjuan/icingaweb2
 /**
  * Screen shortcut
  *
  * @return Screen
  */
 protected function screen()
 {
     if ($this->screen === null) {
         $this->screen = Screen::instance();
     }
     return $this->screen;
 }
コード例 #2
0
ファイル: Command.php プロジェクト: vbereza/icinga2-migration
 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();
     }
 }
コード例 #3
0
ファイル: Cli.php プロジェクト: kobmaki/icingaweb2
 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);
     }
 }