Merge "Allow minor edits to be filtered out of Special:Contributions"
[lhc/web/wiklou.git] / includes / installer / DatabaseInstaller.php
index 152f33a..701403e 100644 (file)
@@ -202,7 +202,7 @@ abstract class DatabaseInstaller {
                        $this->db->commit( __METHOD__ );
                }
                // Resume normal operations
-               if ( $status->isOk() ) {
+               if ( $status->isOK() ) {
                        $this->enableLB();
                }
 
@@ -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 ] );
+               } );
+
        }
 
        /**