‪TYPO3CMS  9.5
ReferenceIndexUpdatedPrerequisite.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types = 1);
3 
5 
6 /*
7  * This file is part of the TYPO3 CMS project.
8  *
9  * It is free software; you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License, either version 2
11  * of the License, or any later version.
12  *
13  * For the full copyright and license information, please read the
14  * LICENSE.txt file that was distributed with this source code.
15  *
16  * The TYPO3 project - inspiring people to share!
17  */
18 
19 use Symfony\Component\Console\Output\OutputInterface;
22 
31 {
35  private ‪$referenceIndex;
39  protected ‪$output;
40 
44  public function ‪__construct()
45  {
46  $this->referenceIndex = GeneralUtility::makeInstance(ReferenceIndex::class);
47  }
48 
52  public function ‪getTitle(): string
53  {
54  return 'Reference Index Up-to-Date';
55  }
56 
62  public function ‪ensure(): bool
63  {
64  $this->referenceIndex->enableRuntimeCache();
65  ob_clean();
66  ob_start();
67  $result = $this->referenceIndex->updateIndex(false, true);
68  ‪$output = ob_get_clean();
69  $this->output->write(‪$output);
70  return $result[2] === 0;
71  }
72 
78  public function ‪isFulfilled(): bool
79  {
80  $this->referenceIndex->enableRuntimeCache();
81  $result = $this->referenceIndex->updateIndex(true, false);
82  return $result[2] === 0;
83  }
84 
88  public function ‪setOutput(OutputInterface ‪$output): void
89  {
90  $this->output = ‪$output;
91  }
92 }
‪TYPO3\CMS\Install\Updates\ReferenceIndexUpdatedPrerequisite\$referenceIndex
‪object TYPO3 CMS Core Database ReferenceIndex $referenceIndex
Definition: ReferenceIndexUpdatedPrerequisite.php:34
‪TYPO3\CMS\Install\Updates\ReferenceIndexUpdatedPrerequisite\__construct
‪__construct()
Definition: ReferenceIndexUpdatedPrerequisite.php:42
‪TYPO3\CMS\Install\Updates\ReferenceIndexUpdatedPrerequisite\ensure
‪bool ensure()
Definition: ReferenceIndexUpdatedPrerequisite.php:60
‪TYPO3\CMS\Core\Database\ReferenceIndex
Definition: ReferenceIndex.php:50
‪TYPO3\CMS\Install\Updates\ChattyInterface
Definition: ChattyInterface.php:25
‪TYPO3\CMS\Install\Updates
Definition: AbstractDownloadExtensionUpdate.php:3
‪TYPO3\CMS\Install\Updates\ReferenceIndexUpdatedPrerequisite\isFulfilled
‪bool isFulfilled()
Definition: ReferenceIndexUpdatedPrerequisite.php:76
‪TYPO3\CMS\Install\Updates\ReferenceIndexUpdatedPrerequisite\getTitle
‪getTitle()
Definition: ReferenceIndexUpdatedPrerequisite.php:50
‪TYPO3\CMS\Install\Updates\PrerequisiteInterface
Definition: PrerequisiteInterface.php:23
‪TYPO3\CMS\Install\Updates\ReferenceIndexUpdatedPrerequisite\$output
‪OutputInterface $output
Definition: ReferenceIndexUpdatedPrerequisite.php:37
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:45
‪TYPO3\CMS\Install\Updates\ReferenceIndexUpdatedPrerequisite
Definition: ReferenceIndexUpdatedPrerequisite.php:31
‪TYPO3\CMS\Install\Updates\ReferenceIndexUpdatedPrerequisite\setOutput
‪setOutput(OutputInterface $output)
Definition: ReferenceIndexUpdatedPrerequisite.php:86