예제 #1
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $output->writeln('<info>Watching templates and pages for changes</info>');
     $files = new Filesystem();
     $tracker = new Tracker();
     $watcher = new Watcher($tracker, $files);
     $generator = $this->getPageGenerator();
     $command = $this;
     $pageListener = $watcher->watch($generator->getPagesDir());
     $pageListener->anything(function ($event, $resource, $path) use($command, $output, $generator) {
         $command->onChange($resource, $path, $output, $generator);
     });
     $templateListener = $watcher->watch($generator->getTemplatesDir());
     $templateListener->anything(function ($event, $resource, $path) use($command, $output, $generator) {
         $command->onChange($resource, $path, $output, $generator);
     });
     $watcher->start();
 }
예제 #2
0
 protected function startWatching()
 {
     $this->watcher->startWatch();
 }