Example #1
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);
     }
 }