find_reparser() public method

If there is no reparser with the specified name, null is returned.
public find_reparser ( string $name ) : string
$name string Name of the reparser to look up.
return string A reparser service name, or null.
Beispiel #1
0
 /**
  * Sets the reparser for this cron task
  *
  * @param string	$reparser
  */
 public function set_reparser($reparser)
 {
     $this->reparser_name = !isset($this->reparsers[$reparser]) ? $this->reparser_manager->find_reparser($reparser) : $reparser;
     if ($this->resume_data === null) {
         $this->reparser_manager->get_resume_data($this->reparser_name);
     }
 }
Beispiel #2
0
 /**
  * Executes the command reparser:reparse
  *
  * @param InputInterface $input
  * @param OutputInterface $output
  * @return integer
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->input = $input;
     $this->output = $output;
     $this->io = new SymfonyStyle($input, $output);
     if (!$this->reparse_lock->acquire()) {
         throw new runtime_exception('REPARSE_LOCK_ERROR', array(), null, 1);
     }
     $name = $input->getArgument('reparser-name');
     if ($name) {
         $name = $this->reparser_manager->find_reparser($name);
         $this->reparse($name);
     } else {
         foreach ($this->reparsers as $name => $service) {
             $this->reparse($name);
         }
     }
     $this->io->success($this->user->lang('CLI_REPARSER_REPARSE_SUCCESS'));
     $this->reparse_lock->release();
     return 0;
 }