From: Marcel Werk Date: Sun, 13 Nov 2016 16:06:08 +0000 (+0100) Subject: Added work-around for detection of older MySQL versions during setup X-Git-Tag: 3.0.0_Beta_5~58 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1ca3de4d04789fd9b52c3d947cb8b54e4192e3a4;p=GitHub%2FWoltLab%2FWCF.git Added work-around for detection of older MySQL versions during setup --- diff --git a/wcfsetup/install/files/lib/system/WCFSetup.class.php b/wcfsetup/install/files/lib/system/WCFSetup.class.php index 188a7a2cc7..f78181c059 100644 --- a/wcfsetup/install/files/lib/system/WCFSetup.class.php +++ b/wcfsetup/install/files/lib/system/WCFSetup.class.php @@ -7,6 +7,7 @@ use wcf\data\package\Package; use wcf\data\user\User; use wcf\data\user\UserAction; use wcf\system\cache\builder\LanguageCacheBuilder; +use wcf\system\database\exception\DatabaseException; use wcf\system\database\util\SQLParser; use wcf\system\database\MySQLDatabase; use wcf\system\exception\SystemException; @@ -649,8 +650,16 @@ class WCFSetup extends WCF { try { // check connection data /** @var \wcf\system\database\Database $db */ - $db = new MySQLDatabase($dbHost, $dbUser, $dbPassword, $dbName, $dbPort, true); - $db->connect(); + try { + $db = new MySQLDatabase($dbHost, $dbUser, $dbPassword, $dbName, $dbPort, true); + } + catch (DatabaseException $e) { + if ($e->getPrevious()->getCode() == 1115) { // work-around for older MySQL versions that don't know utf8mb4 + throw new SystemException("Insufficient MySQL version. Version '5.5.35' or greater is needed."); + } + + throw $e; + } // check sql version $sqlVersion = $db->getVersion();