From: Antoine Musso Date: Tue, 9 Nov 2004 15:25:40 +0000 (+0000) Subject: Patch by "Neil Barsema" : X-Git-Tag: 1.5.0alpha1~1385 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/supprimer.php?a=commitdiff_plain;h=46bd449a17250c519113b5a2e26eb2d846e857b3;p=lhc%2Fweb%2Fwiklou.git Patch by "Neil Barsema" : http://bugzilla.wikipedia.org/show_bug.cgi?id=809 Attempt to load mysql php extension if it is not loaded. --- 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" );