From: Mark A. Hershberger Date: Tue, 3 Jan 2012 19:55:45 +0000 (+0000) Subject: Fix Bug 33384 - database drivers cannot be provided by extension X-Git-Tag: 1.31.0-rc.0~25584 X-Git-Url: http://git.heureux-cyclage.org/?a=commitdiff_plain;h=6fb01643438a894c921e6fbcb57091ce20e6fae8;p=lhc%2Fweb%2Fwiklou.git Fix Bug 33384 - database drivers cannot be provided by extension Author: Adam Wight Love the simplicity of this fix. --- diff --git a/includes/db/Database.php b/includes/db/Database.php index 02938727fe..57d98adf3d 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -675,9 +675,9 @@ abstract class DatabaseBase implements DatabaseType { 'mysql', 'postgres', 'sqlite', 'oracle', 'mssql', 'ibm_db2' ); $dbType = strtolower( $dbType ); + $class = 'Database' . ucfirst( $dbType ); if( in_array( $dbType, $canonicalDBTypes ) ) { - $class = 'Database' . ucfirst( $dbType ); return new $class( isset( $p['host'] ) ? $p['host'] : false, isset( $p['user'] ) ? $p['user'] : false, @@ -686,6 +686,8 @@ abstract class DatabaseBase implements DatabaseType { isset( $p['flags'] ) ? $p['flags'] : 0, isset( $p['tablePrefix'] ) ? $p['tablePrefix'] : 'get from global' ); + } elseif (class_exists($class)) { + return new $class($p); } else { return null; }