From: Tim Düsterhus Date: Wed, 13 Jul 2022 10:08:19 +0000 (+0200) Subject: Add MySQL Native Driver check to update_com.woltlab.wcf_5.6_checkSystemRequirements.php X-Git-Tag: 6.0.0_Alpha_1~1115^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=85d720066f6a4b15ccfe037578e02bcf5403a29f;p=GitHub%2FWoltLab%2FWCF.git Add MySQL Native Driver check to update_com.woltlab.wcf_5.6_checkSystemRequirements.php see #4386 --- diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.6_checkSystemRequirements.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.6_checkSystemRequirements.php index 6a42d30afd..55f1ab11a9 100644 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.6_checkSystemRequirements.php +++ b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.6_checkSystemRequirements.php @@ -52,3 +52,16 @@ if (!\version_compare($compareSQLVersion, $neededSqlVersion, '>=')) { throw new \RuntimeException($message); } + +$sql = "SELECT 1"; +$statement = $db->prepareStatement($sql); +$statement->execute(); +if ($statement->fetchSingleColumn() !== 1) { + if (WCF::getLanguage()->getFixedLanguageCode() === 'de') { + $message = "Für die Kommunikation mit dem MySQL-Server muss PHPs MySQL Native Driver verwendet werden."; + } else { + $message = "PHP's MySQL Native Driver must be used for communication with the MySQL server."; + } + + throw new \RuntimeException($message); +}