‪TYPO3CMS  10.4
DatabaseUpdatedPrerequisite.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
20 use Symfony\Component\Console\Output\OutputInterface;
22 
29 {
33  protected ‪$upgradeWizardsService;
37  protected ‪$output;
38 
39  public function ‪__construct()
40  {
41  $this->upgradeWizardsService = new ‪UpgradeWizardsService();
42  }
43 
47  public function ‪getTitle(): string
48  {
49  return 'Database Up-to-Date';
50  }
51 
52  public function ‪ensure(): bool
53  {
54  $adds = $this->upgradeWizardsService->getBlockingDatabaseAdds();
55  $result = null;
56  if (count($adds) > 0) {
57  $this->output->writeln('Performing ' . count($adds) . ' database operations.');
58  $result = $this->upgradeWizardsService->addMissingTablesAndFields();
59  }
60  return $result === null;
61  }
62 
66  public function ‪isFulfilled(): bool
67  {
68  $adds = $this->upgradeWizardsService->getBlockingDatabaseAdds();
69  return count($adds) === 0;
70  }
71 
75  public function ‪setOutput(OutputInterface ‪$output): void
76  {
77  $this->output = ‪$output;
78  }
79 }
‪TYPO3\CMS\Install\Updates\DatabaseUpdatedPrerequisite\$upgradeWizardsService
‪UpgradeWizardsService $upgradeWizardsService
Definition: DatabaseUpdatedPrerequisite.php:32
‪TYPO3\CMS\Install\Updates\DatabaseUpdatedPrerequisite\ensure
‪ensure()
Definition: DatabaseUpdatedPrerequisite.php:50
‪TYPO3\CMS\Install\Updates\ChattyInterface
Definition: ChattyInterface.php:26
‪TYPO3\CMS\Install\Updates\DatabaseUpdatedPrerequisite
Definition: DatabaseUpdatedPrerequisite.php:29
‪TYPO3\CMS\Install\Service\UpgradeWizardsService
Definition: UpgradeWizardsService.php:43
‪TYPO3\CMS\Install\Updates
Definition: AbstractDownloadExtensionUpdate.php:16
‪TYPO3\CMS\Install\Updates\DatabaseUpdatedPrerequisite\$output
‪OutputInterface $output
Definition: DatabaseUpdatedPrerequisite.php:35
‪TYPO3\CMS\Install\Updates\DatabaseUpdatedPrerequisite\isFulfilled
‪bool isFulfilled()
Definition: DatabaseUpdatedPrerequisite.php:64
‪TYPO3\CMS\Install\Updates\PrerequisiteInterface
Definition: PrerequisiteInterface.php:24
‪TYPO3\CMS\Install\Updates\DatabaseUpdatedPrerequisite\__construct
‪__construct()
Definition: DatabaseUpdatedPrerequisite.php:37
‪TYPO3\CMS\Install\Updates\DatabaseUpdatedPrerequisite\setOutput
‪setOutput(OutputInterface $output)
Definition: DatabaseUpdatedPrerequisite.php:73
‪TYPO3\CMS\Install\Updates\DatabaseUpdatedPrerequisite\getTitle
‪string getTitle()
Definition: DatabaseUpdatedPrerequisite.php:45