‪TYPO3CMS  10.4
ReferenceIndexUpdateCommand.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
18 use Symfony\Component\Console\Command\Command;
19 use Symfony\Component\Console\Input\InputInterface;
20 use Symfony\Component\Console\Input\InputOption;
21 use Symfony\Component\Console\Output\OutputInterface;
22 use Symfony\Component\Console\Style\SymfonyStyle;
27 
31 class ‪ReferenceIndexUpdateCommand extends Command
32 {
36  public function ‪configure()
37  {
38  $this->setDescription('Update the reference index of TYPO3')
39  ->addOption(
40  'check',
41  'c',
42  InputOption::VALUE_NONE,
43  'Only check the reference index of TYPO3'
44  );
45  }
46 
54  protected function ‪execute(InputInterface $input, OutputInterface ‪$output)
55  {
57  $io = new SymfonyStyle($input, ‪$output);
58 
59  $isTestOnly = $input->getOption('check');
60 
61  $progressListener = GeneralUtility::makeInstance(ReferenceIndexProgressListener::class);
62  $progressListener->initialize($io);
63  $referenceIndex = GeneralUtility::makeInstance(ReferenceIndex::class);
64  $referenceIndex->enableRuntimeCache();
65  if ($isTestOnly) {
66  $io->section('Reference Index being TESTED (nothing written, remove the "--check" argument)');
67  } else {
68  $io->section('Reference Index is now being updated');
69  }
70  $referenceIndex->updateIndex($isTestOnly, $progressListener);
71  return 0;
72  }
73 }
‪TYPO3\CMS\Backend\Command\ReferenceIndexUpdateCommand\execute
‪int execute(InputInterface $input, OutputInterface $output)
Definition: ReferenceIndexUpdateCommand.php:54
‪TYPO3\CMS\Backend\Command\ProgressListener\ReferenceIndexProgressListener
Definition: ReferenceIndexProgressListener.php:30
‪TYPO3\CMS\Core\Database\ReferenceIndex
Definition: ReferenceIndex.php:48
‪TYPO3\CMS\Core\Core\Bootstrap\initializeBackendAuthentication
‪static initializeBackendAuthentication($proceedIfNoUserIsLoggedIn=false)
Definition: Bootstrap.php:607
‪TYPO3\CMS\Backend\Command
Definition: LockBackendCommand.php:16
‪$output
‪$output
Definition: annotationChecker.php:119
‪TYPO3\CMS\Core\Core\Bootstrap
Definition: Bootstrap.php:66
‪TYPO3\CMS\Backend\Command\ReferenceIndexUpdateCommand\configure
‪configure()
Definition: ReferenceIndexUpdateCommand.php:36
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46
‪TYPO3\CMS\Backend\Command\ReferenceIndexUpdateCommand
Definition: ReferenceIndexUpdateCommand.php:32