[BUGFIX] Detect upper limit of database server version 48/53148/4
authorMarkus Klein <markus.klein@typo3.org>
Wed, 7 Jun 2017 08:44:55 +0000 (10:44 +0200)
committerAlexander Opitz <opitz.alexander@googlemail.com>
Wed, 7 Jun 2017 14:09:10 +0000 (16:09 +0200)
Resolves: #81341
Releases: 7.6
Change-Id: Ia188901497d29ff2a2274a4bf220e7c58e665487
Reviewed-on: https://review.typo3.org/53148
Reviewed-by: Johannes Kasberger <johannes.kasberger@reelworx.at>
Tested-by: Johannes Kasberger <johannes.kasberger@reelworx.at>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Alexander Opitz <opitz.alexander@googlemail.com>
Tested-by: Alexander Opitz <opitz.alexander@googlemail.com>
typo3/sysext/install/Classes/SystemEnvironment/DatabaseCheck.php

index 6a17124..617fb32 100644 (file)
@@ -95,16 +95,44 @@ class DatabaseCheck
                 $currentMysqlVersion = $result[1];
             }
         }
-        if (version_compare($currentMysqlVersion, $minimumMysqlVersion) < 0) {
-            $status = new Status\ErrorStatus();
-            $status->setTitle('MySQL version too low');
-            $status->setMessage(
-                'Your MySQL version ' . $currentMysqlVersion . ' is too old. TYPO3 CMS does not run' .
-                ' with this version. Update to at least MySQL ' . $minimumMysqlVersion
-            );
+        if (strpos($currentMysqlVersion, 'MariaDB') !== false) {
+            $notSupportedVersion = '10.2.0';
+            if (version_compare($currentMysqlVersion, $minimumMysqlVersion) < 0) {
+                $status = new Status\ErrorStatus();
+                $status->setTitle('MariaDB version too low');
+                $status->setMessage(
+                    'Your MariaDB version ' . $currentMysqlVersion . ' is too old. TYPO3 CMS does not run' .
+                    ' with this version. Update to at least MariaDB ' . $minimumMysqlVersion
+                );
+            } elseif (version_compare($currentMysqlVersion, $notSupportedVersion) >= 0) {
+                $status = new Status\ErrorStatus();
+                $status->setTitle('MariaDB version too high');
+                $status->setMessage(
+                    'Your MariaDB version ' . $currentMysqlVersion . ' is too new. TYPO3 CMS does not run with this version.'
+                );
+            } else {
+                $status = new Status\OkStatus();
+                $status->setTitle('MariaDB version is fine');
+            }
         } else {
-            $status = new Status\OkStatus();
-            $status->setTitle('MySQL version is fine');
+            $notSupportedVersion = '8.0.0';
+            if (version_compare($currentMysqlVersion, $minimumMysqlVersion) < 0) {
+                $status = new Status\ErrorStatus();
+                $status->setTitle('MySQL version too low');
+                $status->setMessage(
+                    'Your MySQL version ' . $currentMysqlVersion . ' is too old. TYPO3 CMS does not run' .
+                    ' with this version. Update to at least MySQL ' . $minimumMysqlVersion
+                );
+            } elseif (version_compare($currentMysqlVersion, $notSupportedVersion) >= 0) {
+                $status = new Status\ErrorStatus();
+                $status->setTitle('MySQL version too high');
+                $status->setMessage(
+                    'Your MySQL version ' . $currentMysqlVersion . ' is too new. TYPO3 CMS does not run with this version.'
+                );
+            } else {
+                $status = new Status\OkStatus();
+                $status->setTitle('MySQL version is fine');
+            }
         }
 
         return $status;