‪TYPO3CMS  9.5
DatabaseUpdatedPrerequisite.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;
21 
28 {
32  protected ‪$upgradeWizardsService;
36  protected ‪$output;
37 
38  public function ‪__construct()
39  {
40  $this->upgradeWizardsService = new ‪UpgradeWizardsService();
41  }
42 
46  public function ‪getTitle(): string
47  {
48  return 'Database Up-to-Date';
49  }
50 
53  public function ‪ensure(): bool
54  {
55  $adds = $this->upgradeWizardsService->getBlockingDatabaseAdds();
56  $result = null;
57  if (count($adds) > 0) {
58  $this->output->writeln('Performing ' . count($adds) . ' database operations.');
59  $result = $this->upgradeWizardsService->addMissingTablesAndFields();
60  }
61  return $result === null;
62  }
63 
67  public function ‪isFulfilled(): bool
68  {
69  $adds = $this->upgradeWizardsService->getBlockingDatabaseAdds();
70  return count($adds) === 0;
71  }
72 
76  public function ‪setOutput(OutputInterface ‪$output): void
77  {
78  $this->output = ‪$output;
79  }
80 }
‪TYPO3\CMS\Install\Updates\DatabaseUpdatedPrerequisite\$upgradeWizardsService
‪UpgradeWizardsService $upgradeWizardsService
Definition: DatabaseUpdatedPrerequisite.php:31
‪TYPO3\CMS\Install\Updates\DatabaseUpdatedPrerequisite\ensure
‪ensure()
Definition: DatabaseUpdatedPrerequisite.php:51
‪TYPO3\CMS\Install\Updates\ChattyInterface
Definition: ChattyInterface.php:25
‪TYPO3\CMS\Install\Updates\DatabaseUpdatedPrerequisite
Definition: DatabaseUpdatedPrerequisite.php:28
‪TYPO3\CMS\Install\Service\UpgradeWizardsService
Definition: UpgradeWizardsService.php:42
‪TYPO3\CMS\Install\Updates
Definition: AbstractDownloadExtensionUpdate.php:3
‪TYPO3\CMS\Install\Updates\DatabaseUpdatedPrerequisite\$output
‪OutputInterface $output
Definition: DatabaseUpdatedPrerequisite.php:34
‪TYPO3\CMS\Install\Updates\DatabaseUpdatedPrerequisite\isFulfilled
‪bool isFulfilled()
Definition: DatabaseUpdatedPrerequisite.php:65
‪TYPO3\CMS\Install\Updates\PrerequisiteInterface
Definition: PrerequisiteInterface.php:23
‪TYPO3\CMS\Install\Updates\DatabaseUpdatedPrerequisite\__construct
‪__construct()
Definition: DatabaseUpdatedPrerequisite.php:36
‪TYPO3\CMS\Install\Updates\DatabaseUpdatedPrerequisite\setOutput
‪setOutput(OutputInterface $output)
Definition: DatabaseUpdatedPrerequisite.php:74
‪TYPO3\CMS\Install\Updates\DatabaseUpdatedPrerequisite\getTitle
‪string getTitle()
Definition: DatabaseUpdatedPrerequisite.php:44