Configure LoadBalancer with $wgSharedTables after WAN cache autodetection
[lhc/web/wiklou.git] / includes / Setup.php
index 071b7c6..a51cb83 100644 (file)
@@ -605,20 +605,6 @@ if ( $wgDebugToolbar && !$wgCommandLineMode ) {
 // re-created while taking into account any custom settings and extensions.
 MediaWikiServices::resetGlobalInstance( new GlobalVarConfig(), 'quick' );
 
-if ( $wgSharedDB && $wgSharedTables ) {
-       // Apply $wgSharedDB table aliases for the local LB (all non-foreign DB connections)
-       MediaWikiServices::getInstance()->getDBLoadBalancer()->setTableAliases(
-               array_fill_keys(
-                       $wgSharedTables,
-                       [
-                               'dbname' => $wgSharedDB,
-                               'schema' => $wgSharedSchema,
-                               'prefix' => $wgSharedPrefix
-                       ]
-               )
-       );
-}
-
 // Define a constant that indicates that the bootstrapping of the service locator
 // is complete.
 define( 'MW_SERVICE_BOOTSTRAP_COMPLETE', 1 );
@@ -694,6 +680,20 @@ if ( $wgMainWANCache === false ) {
        ];
 }
 
+if ( $wgSharedDB && $wgSharedTables ) {
+       // Apply $wgSharedDB table aliases for the local LB (all non-foreign DB connections)
+       MediaWikiServices::getInstance()->getDBLoadBalancer()->setTableAliases(
+               array_fill_keys(
+                       $wgSharedTables,
+                       [
+                               'dbname' => $wgSharedDB,
+                               'schema' => $wgSharedSchema,
+                               'prefix' => $wgSharedPrefix
+                       ]
+               )
+       );
+}
+
 Profiler::instance()->scopedProfileOut( $ps_default2 );
 
 $ps_misc = Profiler::instance()->scopedProfileIn( $fname . '-misc' );