From: Alexandre Emsenhuber Date: Wed, 1 Oct 2008 16:39:05 +0000 (+0000) Subject: Allow to specify per connection table prefix X-Git-Tag: 1.31.0-rc.0~44968 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=ac1d1addfd1ebd44879d99b3d8bf1c22fcd09a2a;p=lhc%2Fweb%2Fwiklou.git Allow to specify per connection table prefix --- diff --git a/includes/db/LoadBalancer.php b/includes/db/LoadBalancer.php index 16c4b316fb..6910ce90af 100644 --- a/includes/db/LoadBalancer.php +++ b/includes/db/LoadBalancer.php @@ -639,12 +639,17 @@ class LoadBalancer { $dbname = $dbNameOverride; } + if( !isset( $prefix ) ){ + global $wgDBprefix; + $prefix = $wgDBprefix; + } + # Get class for this database type $class = 'Database' . ucfirst( $type ); # Create object wfDebug( "Connecting to $host $dbname...\n" ); - $db = new $class( $host, $user, $password, $dbname, 1, $flags ); + $db = new $class( $host, $user, $password, $dbname, 1, $flags, $prefix ); if ( $db->isOpen() ) { wfDebug( "Connected\n" ); } else {