X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FSetup.php;h=a51cb83c19dc6f852bc150f92b352cf969e67703;hb=420c0e0f42509be4b404c74efeb6f77e93bf9599;hp=bcdc1d57a200784d8f3a48c9d2eb86de5ab248d1;hpb=befe7d531442335119552aaa56455651eccbc79f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Setup.php b/includes/Setup.php index bcdc1d57a2..a51cb83c19 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -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' ); @@ -736,9 +736,10 @@ $cpPosInfo = LBFactory::getCPInfoFromCookieValue( MediaWikiServices::getInstance()->getDBLoadBalancerFactory()->setRequestInfo( [ 'IPAddress' => $wgRequest->getIP(), 'UserAgent' => $wgRequest->getHeader( 'User-Agent' ), - 'ChronologyProtection' => $wgRequest->getHeader( 'ChronologyProtection' ), + 'ChronologyProtection' => $wgRequest->getHeader( 'MediaWiki-Chronology-Protection' ), 'ChronologyPositionIndex' => $wgRequest->getInt( 'cpPosIndex', $cpPosInfo['index'] ), 'ChronologyClientId' => $cpPosInfo['clientId'] + ?? $wgRequest->getHeader( 'MediaWiki-Chronology-Client-Id' ) ] ); unset( $cpPosInfo ); // Make sure that object caching does not undermine the ChronologyProtector improvements