From f620f16e2b62cc12e8b2a155d8f764dd8bafefe8 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 6 Jun 2025 09:56:27 +0200 Subject: Install: add test PDO typing (#7651) fix https://github.com/FreshRSS/FreshRSS/issues/7647 --- app/install.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'app/install.php') diff --git a/app/install.php b/app/install.php index c2fd86370..3d835d1f1 100644 --- a/app/install.php +++ b/app/install.php @@ -234,6 +234,17 @@ function saveStep3(): bool { $ok = false; try { + Minz_ModelPdo::$usesSharedPdo = false; + $databaseDAO = FreshRSS_Factory::createDatabaseDAO(Minz_User::INTERNAL_USER); + if (!$databaseDAO->testTyping()) { + $message = 'Invalid PDO driver behaviour for selected database type!'; + if (Minz_Session::paramString('bd_type') === 'mysql') { + $message .= ' MySQL requires mysqlnd.'; + } + throw new Exception($message); + } + Minz_ModelPdo::$usesSharedPdo = true; + $ok = FreshRSS_user_Controller::createUser( Minz_Session::paramString('default_user'), '', //TODO: Add e-mail @@ -249,6 +260,7 @@ function saveStep3(): bool { $ok = false; } if (!$ok) { + checkStep(); return false; } @@ -526,7 +538,7 @@ function printStep2(): void {

+ (empty($_SESSION['bd_error']) || !is_string($_SESSION['bd_error']) ? '' : ' ' . $_SESSION['bd_error']) ?>

-- cgit v1.2.3