From 46bd449a17250c519113b5a2e26eb2d846e857b3 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Tue, 9 Nov 2004 15:25:40 +0000 Subject: [PATCH] Patch by "Neil Barsema" : http://bugzilla.wikipedia.org/show_bug.cgi?id=809 Attempt to load mysql php extension if it is not loaded. --- includes/Database.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/Database.php b/includes/Database.php index 75440d64fb..b6153a3b6f 100644 --- a/includes/Database.php +++ b/includes/Database.php @@ -180,6 +180,11 @@ class Database { */ function open( $server, $user, $password, $dbName ) { # Test for missing mysql.so + # First try to load it + if (!@extension_loaded('mysql')) { + @dl('mysql.so'); + } + # Otherwise we get a suppressed fatal error, which is very hard to track down if ( !function_exists( 'mysql_connect' ) ) { die( "MySQL functions missing, have you compiled PHP with the --with-mysql option?\n" ); -- 2.20.1