‪TYPO3CMS  10.4
RedirectExtractionUpdate.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 
21 
27 {
31  protected ‪$extension;
32 
36  protected ‪$confirmation;
37 
38  public function ‪__construct()
39  {
40  $this->extension = new ‪ExtensionModel(
41  'rdct',
42  'Redirects based on &RDCT parameter',
43  '1.0.0',
44  'friendsoftypo3/rdct',
45  'The extension provides redirects based on "cache_md5params" and the GET parameter &RDCT for extensions that still rely on it.'
46  );
47 
48  $this->confirmation = new ‪Confirmation(
49  'Are you sure?',
50  'You should install the Redirects extension only if needed. ' . $this->extension->getDescription(),
51  false
52  );
53  }
54 
60  public function ‪getConfirmation(): ‪Confirmation
61  {
63  }
64 
71  public function ‪getIdentifier(): string
72  {
73  return 'rdctExtension';
74  }
75 
81  public function ‪getTitle(): string
82  {
83  return 'Install extension "rdct" from TER if DB table cache_md5params is filled';
84  }
85 
91  public function ‪getDescription(): string
92  {
93  return 'The extension "rdct" includes redirects based on the GET parameter &RDCT. The functionality has been extracted to'
94  . ' the TYPO3 Extension Repository. This update downloads the TYPO3 extension from the TER.'
95  . ' Use this if you are dealing with extensions in the instance that rely on this kind of redirects.';
96  }
97 
104  public function ‪updateNecessary(): bool
105  {
107  }
108 
115  protected function ‪checkIfWizardIsRequired(): bool
116  {
117  $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
118  $connection = $connectionPool->getConnectionByName('Default');
119  $tableNames = $connection->getSchemaManager()->listTableNames();
120  if (in_array('cache_md5params', $tableNames, true)) {
121  // table is available, now check if there are entries in it
122  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
123  ->getQueryBuilderForTable('cache_md5params');
124  $numberOfEntries = $queryBuilder->count('*')
125  ->from('cache_md5params')
126  ->execute()
127  ->fetchColumn();
128  return (bool)$numberOfEntries;
129  }
130 
131  return false;
132  }
133 
141  public function ‪getPrerequisites(): array
142  {
143  return [
144  DatabaseUpdatedPrerequisite::class
145  ];
146  }
147 }
‪TYPO3\CMS\Install\Updates\RedirectExtractionUpdate\getPrerequisites
‪string[] getPrerequisites()
Definition: RedirectExtractionUpdate.php:139
‪TYPO3\CMS\Install\Updates
Definition: AbstractDownloadExtensionUpdate.php:16
‪TYPO3\CMS\Core\Utility\ExtensionManagementUtility
Definition: ExtensionManagementUtility.php:43
‪TYPO3\CMS\Install\Updates\RedirectExtractionUpdate\checkIfWizardIsRequired
‪bool checkIfWizardIsRequired()
Definition: RedirectExtractionUpdate.php:113
‪TYPO3\CMS\Install\Updates\ExtensionModel
Definition: ExtensionModel.php:26
‪TYPO3\CMS\Install\Updates\Confirmation
Definition: Confirmation.php:21
‪TYPO3\CMS\Install\Updates\RedirectExtractionUpdate\getTitle
‪string getTitle()
Definition: RedirectExtractionUpdate.php:79
‪TYPO3\CMS\Install\Updates\RedirectExtractionUpdate\$extension
‪TYPO3 CMS Install Updates ExtensionModel $extension
Definition: RedirectExtractionUpdate.php:30
‪TYPO3\CMS\Install\Updates\AbstractDownloadExtensionUpdate
Definition: AbstractDownloadExtensionUpdate.php:31
‪TYPO3\CMS\Install\Updates\RedirectExtractionUpdate
Definition: RedirectExtractionUpdate.php:27
‪TYPO3\CMS\Install\Updates\RedirectExtractionUpdate\updateNecessary
‪bool updateNecessary()
Definition: RedirectExtractionUpdate.php:102
‪TYPO3\CMS\Install\Updates\RedirectExtractionUpdate\__construct
‪__construct()
Definition: RedirectExtractionUpdate.php:36
‪TYPO3\CMS\Core\Database\ConnectionPool
Definition: ConnectionPool.php:46
‪TYPO3\CMS\Install\Updates\RedirectExtractionUpdate\getConfirmation
‪TYPO3 CMS Install Updates Confirmation getConfirmation()
Definition: RedirectExtractionUpdate.php:58
‪TYPO3\CMS\Install\Updates\RedirectExtractionUpdate\getIdentifier
‪string getIdentifier()
Definition: RedirectExtractionUpdate.php:69
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46
‪TYPO3\CMS\Install\Updates\RedirectExtractionUpdate\$confirmation
‪TYPO3 CMS Install Updates Confirmation $confirmation
Definition: RedirectExtractionUpdate.php:34
‪TYPO3\CMS\Core\Utility\ExtensionManagementUtility\isLoaded
‪static bool isLoaded($key)
Definition: ExtensionManagementUtility.php:114
‪TYPO3\CMS\Install\Updates\RedirectExtractionUpdate\getDescription
‪string getDescription()
Definition: RedirectExtractionUpdate.php:89