Merge "Allow minor edits to be filtered out of Special:Contributions"
[lhc/web/wiklou.git] / includes / installer / DatabaseInstaller.php
index 79bd961..701403e 100644 (file)
@@ -287,8 +287,16 @@ abstract class DatabaseInstaller {
                if ( !$status->isOK() ) {
                        throw new MWException( __METHOD__ . ': unexpected DB connection error' );
                }
-               LBFactory::setInstance( new LBFactorySingle( [
-                       'connection' => $status->value ] ) );
+
+               \MediaWiki\MediaWikiServices::resetGlobalInstance();
+               $services = \MediaWiki\MediaWikiServices::getInstance();
+
+               $connection = $status->value;
+               $services->redefineService( 'DBLoadBalancerFactory', function() use ( $connection ) {
+                       return new LBFactorySingle( [
+                               'connection' => $connection ] );
+               } );
+
        }
 
        /**