[TASK] Remove version matrix hack from CoreVersionService 24/43424/2
authorAndreas Bouche <andreas.bouche@flagbit.de>
Fri, 18 Sep 2015 14:16:06 +0000 (16:16 +0200)
committerBenni Mack <benni@typo3.org>
Sat, 19 Sep 2015 20:19:48 +0000 (22:19 +0200)
Replace the old 'manual' way of reducing the version
matrix with an automatic solution.

Resolves: #69935
Releases: master
Change-Id: Iec8a650e0ffd471e66d6a6b495eff7170e634356
Reviewed-on: http://review.typo3.org/43424
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Tested-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/install/Classes/Service/CoreVersionService.php

index e335d6b..3014724 100644 (file)
@@ -75,14 +75,14 @@ class CoreVersionService {
         */
        public function updateVersionMatrix() {
                $versionArray = $this->fetchVersionMatrixFromRemote();
-               // This is a 'hack' to keep the string stored in the registry small. We are usually only
-               // interested in information from 7 and up and older releases do not matter in current
-               // use cases. If this unset() is removed and everything is stored for some reason, the
-               // table sys_file field entry_value needs to be extended from blob to longblob.
-               unset($versionArray['6.2'], $versionArray['6.1'], $versionArray['6.0'], $versionArray['4.7'], $versionArray['4.6'],
-                       $versionArray['4.5'], $versionArray['4.4'], $versionArray['4.3'], $versionArray['4.2'],
-                       $versionArray['4.1'], $versionArray['4.0'], $versionArray['3.8'], $versionArray['3.7'],
-                       $versionArray['3.6'], $versionArray['3.5'], $versionArray['3.3']);
+               $installedMajorVersion = (int)$this->getInstalledMajorVersion();
+
+               foreach ($versionArray as $versionNumber => $versionDetails) {
+                       if (is_array($versionDetails) && (int)$this->getMajorVersion($versionNumber) < $installedMajorVersion) {
+                               unset($versionArray[$versionNumber]);
+                       }
+               }
+
                $this->registry->set('TYPO3.CMS.Install', 'coreVersionMatrix', $versionArray);
        }