// 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 );
// initialize the request object in $wgRequest
$wgRequest = RequestContext::getMain()->getRequest(); // BackCompat
+// Set user IP/agent information for causal consistency purposes
+MediaWikiServices::getInstance()->getDBLoadBalancerFactory()->setRequestInfo( [
+ 'IPAddress' => $wgRequest->getIP(),
+ 'UserAgent' => $wgRequest->getHeader( 'User-Agent' ),
+ 'ChronologyProtection' => $wgRequest->getHeader( 'ChronologyProtection' )
+] );
// Useful debug output
if ( $wgCommandLineMode ) {