Example #1
0
 protected function doRun()
 {
     $this->data = ['files' => [], 'data' => []];
     $this->logger = $this->container->get('logger');
     $this->io = $this->container->get('io');
     $this->loop = $this->container->get('eventloop');
     $this->factory = $this->container->get('factory');
     $this->project = $this->container->get('project');
     $this->cachePath = $this->io->getCacheDir('indexer') . '/' . sha1($this->project->getRootPath()) . '.json';
     $this->updateQueue = new \SplQueue();
     $this->loadCache();
     $fsEvents = ['modify', 'delete', 'move_to', 'move_from'];
     $this->monitor = new INotifyProcessMonitor($this->project->getRootPath(), $fsEvents);
     $this->setupFsEvents();
     $this->watch();
 }
Example #2
0
 public function createIndexerContainer(Project $project, $path, $contents = '')
 {
     $container = new Container($project->getProjectContainer());
     $container->set('file', new SourceFile($container, $path, $contents));
     foreach ($this->plugins as $plugin) {
         $plugin->addIndexerComponents($container, $this->options);
     }
     return $container;
 }