X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2FSetup.php;h=a51cb83c19dc6f852bc150f92b352cf969e67703;hb=ef752a33bbc796ec7c3d555e43c02f611af8c29a;hp=3f6a5b49e07b3bc49c9026a4795a0afe99f5e528;hpb=7110e89e542f972bc148ece238829f00fb2e1053;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Setup.php b/includes/Setup.php index 3f6a5b49e0..a51cb83c19 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -492,7 +492,7 @@ $wgCanonicalNamespaceNames = [ /// @todo UGLY UGLY if ( is_array( $wgExtraNamespaces ) ) { - $wgCanonicalNamespaceNames = $wgCanonicalNamespaceNames + $wgExtraNamespaces; + $wgCanonicalNamespaceNames += $wgExtraNamespaces; } // Hard-deprecate setting $wgDummyLanguageCodes in LocalSettings.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