‪TYPO3CMS  ‪main
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->addOption(
39  'check',
40  'c',
41  InputOption::VALUE_NONE,
42  'Only check the reference index of TYPO3'
43  );
44  }
45 
49  protected function ‪execute(InputInterface $input, OutputInterface ‪$output): int
50  {
52  $io = new SymfonyStyle($input, ‪$output);
53 
54  $isTestOnly = (bool)$input->getOption('check');
55 
56  $progressListener = GeneralUtility::makeInstance(ReferenceIndexProgressListener::class);
57  $progressListener->initialize($io);
58  $referenceIndex = GeneralUtility::makeInstance(ReferenceIndex::class);
59  if ($isTestOnly) {
60  $io->section('Reference Index being TESTED (nothing written, remove the "--check" argument)');
61  } else {
62  $io->section('Reference Index is now being updated');
63  }
64  $referenceIndex->updateIndex($isTestOnly, $progressListener);
65  return Command::SUCCESS;
66  }
67 }
‪TYPO3\CMS\Backend\Command\ProgressListener\ReferenceIndexProgressListener
Definition: ReferenceIndexProgressListener.php:30
‪TYPO3\CMS\Core\Database\ReferenceIndex
Definition: ReferenceIndex.php:40
‪TYPO3\CMS\Backend\Command
Definition: CreateBackendUserCommand.php:18
‪$output
‪$output
Definition: annotationChecker.php:119
‪TYPO3\CMS\Backend\Command\ReferenceIndexUpdateCommand\execute
‪execute(InputInterface $input, OutputInterface $output)
Definition: ReferenceIndexUpdateCommand.php:49
‪TYPO3\CMS\Core\Core\Bootstrap
Definition: Bootstrap.php:64
‪TYPO3\CMS\Backend\Command\ReferenceIndexUpdateCommand\configure
‪configure()
Definition: ReferenceIndexUpdateCommand.php:36
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:51
‪TYPO3\CMS\Backend\Command\ReferenceIndexUpdateCommand
Definition: ReferenceIndexUpdateCommand.php:32
‪TYPO3\CMS\Core\Core\Bootstrap\initializeBackendAuthentication
‪static initializeBackendAuthentication()
Definition: Bootstrap.php:529