コード例 #1
0
 /**
  * @inheritdoc
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     // Initialize the index, which is both the worker
     // and the interface to the database.
     $options = $this->getApplication()->options;
     $index = new Index($options);
     // Tell the index where to log to.
     // This also allows it access to the verbosity option.
     $index->setOutput($output);
     $index->rebuild();
 }
コード例 #2
0
 /**
  * @inheritdoc
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     // Initialize the index, which is both the worker
     // and the interface to the database.
     $options = $this->getApplication()->options;
     $index = new Index($options);
     // Tell the index where to log to.
     // This also allows it access to the verbosity option.
     $index->setOutput($output);
     if ($input->getOption('drop')) {
         $index->rebuild();
         $output->writeln('Emptied database.');
     } else {
         $index->resetAllStatus();
         $output->writeln('Reset the status of all items.');
     }
 }