protected function execute(InputInterface $input, OutputInterface $output)
 {
     $index = $input->getOption('index');
     $type = $input->getOption('type');
     if (!$index) {
         $index = 'iphp';
     }
     $provider = $this->providerRegistry->getProvider($index, $type);
     $output->writeln(method_exists($provider, 'entriesNum') ? $provider->entriesNum() : 0);
 }
Beispiel #2
0
 /**
  * Deletes/remaps an index type, populates it, and refreshes the index.
  *
  * @param OutputInterface $output
  * @param string          $index
  * @param string          $type
  * @param boolean         $reset
  */
 private function populateIndexTypeLimit(OutputInterface $output, $index, $type, $reset, $limit, $start)
 {
     if ($reset) {
         $output->writeln(sprintf('Resetting: %s/%s', $index, $type));
         $this->resetter->resetIndexType($index, $type);
     }
     $loggerClosure = function ($message) use($output, $index, $type) {
         $output->writeln(sprintf('Populating: %s/%s, %s', $index, $type, $message));
     };
     $provider = $this->providerRegistry->getProvider($index, $type);
     $provider->populate($loggerClosure, array('limit' => $limit, 'start' => $start));
     $output->writeln(sprintf('Refreshing: %s', $index));
     $this->indexManager->getIndex($index)->refresh();
 }
Beispiel #3
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $output->writeln(implode(' ', array_keys($this->providerRegistry->getIndexProviders('iphp'))));
 }