‪TYPO3CMS  9.5
RedirectExtractionUpdate.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
20 
26 {
30  protected ‪$extension;
31 
35  protected ‪$confirmation;
36 
37  public function ‪__construct()
38  {
39  $this->extension = new ‪ExtensionModel(
40  'rdct',
41  'Redirects based on &RDCT parameter',
42  '1.0.0',
43  'friendsoftypo3/rdct',
44  'The extension provides redirects based on "cache_md5params" and the GET parameter &RDCT for extensions that still rely on it.'
45  );
46 
47  $this->confirmation = new ‪Confirmation(
48  'Are you sure?',
49  'You should install the Redirects extension only if needed. ' . $this->extension->getDescription(),
50  false
51  );
52  }
53 
59  public function ‪getConfirmation(): ‪Confirmation
60  {
62  }
63 
70  public function ‪getIdentifier(): string
71  {
72  return 'rdctExtension';
73  }
74 
80  public function ‪getTitle(): string
81  {
82  return 'Install extension "rdct" from TER if DB table cache_md5params is filled';
83  }
84 
90  public function ‪getDescription(): string
91  {
92  return 'The extension "rdct" includes redirects based on the GET parameter &RDCT. The functionality has been extracted to'
93  . ' the TYPO3 Extension Repository. This update downloads the TYPO3 extension from the TER.'
94  . ' Use this if you are dealing with extensions in the instance that rely on this kind of redirects.';
95  }
96 
103  public function ‪updateNecessary(): bool
104  {
106  }
107 
114  protected function ‪checkIfWizardIsRequired(): bool
115  {
116  $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
117  $connection = $connectionPool->getConnectionByName('Default');
118  $tableNames = $connection->getSchemaManager()->listTableNames();
119  if (in_array('cache_md5params', $tableNames, true)) {
120  // table is available, now check if there are entries in it
121  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
122  ->getQueryBuilderForTable('cache_md5params');
123  $numberOfEntries = $queryBuilder->count('*')
124  ->from('cache_md5params')
125  ->execute()
126  ->fetchColumn();
127  return (bool)$numberOfEntries;
128  }
129 
130  return false;
131  }
132 
140  public function ‪getPrerequisites(): array
141  {
142  return [
143  DatabaseUpdatedPrerequisite::class
144  ];
145  }
146 }
‪TYPO3\CMS\Install\Updates\RedirectExtractionUpdate\getPrerequisites
‪string[] getPrerequisites()
Definition: RedirectExtractionUpdate.php:138
‪TYPO3\CMS\Install\Updates
Definition: AbstractDownloadExtensionUpdate.php:3
‪TYPO3\CMS\Core\Utility\ExtensionManagementUtility
Definition: ExtensionManagementUtility.php:36
‪TYPO3\CMS\Install\Updates\RedirectExtractionUpdate\checkIfWizardIsRequired
‪bool checkIfWizardIsRequired()
Definition: RedirectExtractionUpdate.php:112
‪TYPO3\CMS\Install\Updates\ExtensionModel
Definition: ExtensionModel.php:25
‪TYPO3\CMS\Install\Updates\Confirmation
Definition: Confirmation.php:20
‪TYPO3\CMS\Core\Utility\ExtensionManagementUtility\isLoaded
‪static bool isLoaded($key, $exitOnError=null)
Definition: ExtensionManagementUtility.php:115
‪TYPO3\CMS\Install\Updates\RedirectExtractionUpdate\getTitle
‪string getTitle()
Definition: RedirectExtractionUpdate.php:78
‪TYPO3\CMS\Install\Updates\RedirectExtractionUpdate\$extension
‪TYPO3 CMS Install Updates ExtensionModel $extension
Definition: RedirectExtractionUpdate.php:29
‪TYPO3\CMS\Install\Updates\AbstractDownloadExtensionUpdate
Definition: AbstractDownloadExtensionUpdate.php:31
‪TYPO3\CMS\Install\Updates\RedirectExtractionUpdate
Definition: RedirectExtractionUpdate.php:26
‪TYPO3\CMS\Install\Updates\RedirectExtractionUpdate\updateNecessary
‪bool updateNecessary()
Definition: RedirectExtractionUpdate.php:101
‪TYPO3\CMS\Install\Updates\RedirectExtractionUpdate\__construct
‪__construct()
Definition: RedirectExtractionUpdate.php:35
‪TYPO3\CMS\Core\Database\ConnectionPool
Definition: ConnectionPool.php:44
‪TYPO3\CMS\Install\Updates\RedirectExtractionUpdate\getConfirmation
‪TYPO3 CMS Install Updates Confirmation getConfirmation()
Definition: RedirectExtractionUpdate.php:57
‪TYPO3\CMS\Install\Updates\RedirectExtractionUpdate\getIdentifier
‪string getIdentifier()
Definition: RedirectExtractionUpdate.php:68
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:45
‪TYPO3\CMS\Install\Updates\RedirectExtractionUpdate\$confirmation
‪TYPO3 CMS Install Updates Confirmation $confirmation
Definition: RedirectExtractionUpdate.php:33
‪TYPO3\CMS\Install\Updates\RedirectExtractionUpdate\getDescription
‪string getDescription()
Definition: RedirectExtractionUpdate.php:88