From 8de09129430e4abd1e84fee1f87cd68df96c7a26 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Sat, 15 Jul 2023 21:11:12 -0700 Subject: [PATCH] DbUtil - Report MySQL failures consistently on php7+php8 --- setup/src/Setup/DbUtil.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/setup/src/Setup/DbUtil.php b/setup/src/Setup/DbUtil.php index d62bf0b00d..89c4d24e4b 100644 --- a/setup/src/Setup/DbUtil.php +++ b/setup/src/Setup/DbUtil.php @@ -87,6 +87,11 @@ class DbUtil { * @throws SqlException */ public static function connect($db) { + // During installation, we need to test proposed credentials. Ensure that tests report failure the same way on php7+php8. + if (version_compare(PHP_VERSION, '8', '>=')) { + mysqli_report(MYSQLI_REPORT_OFF); + } + $conn = self::softConnect($db); if (mysqli_connect_errno()) { throw new SqlException(sprintf("Connection failed: %s\n", mysqli_connect_error())); -- 2.25.1