From ac1d1addfd1ebd44879d99b3d8bf1c22fcd09a2a Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Wed, 1 Oct 2008 16:39:05 +0000 Subject: [PATCH] Allow to specify per connection table prefix --- includes/db/LoadBalancer.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 { -- 2.20.1