X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2FSetup.php;h=d1f225b5fc6acb4a08207ca552e4ce79f461fa79;hp=e4396ba9261c0af617032480e1f946d5f2f78cf4;hb=86d7bd86fa08db2dbf3651a656d8238a34703c4f;hpb=2b7fbceb23a4737de36cfc48d542a21dd6f53a7a diff --git a/includes/Setup.php b/includes/Setup.php index e4396ba926..d1f225b5fc 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -37,8 +37,11 @@ if ( !defined( 'MEDIAWIKI' ) ) { * Pre-config setup: Before loading LocalSettings.php */ -// Grab profiling functions -require_once "$IP/includes/profiler/ProfilerFunctions.php"; +// Get profiler configuraton +$wgProfiler = []; +if ( file_exists( "$IP/StartProfiler.php" ) ) { + require "$IP/StartProfiler.php"; +} // Start the autoloader, so that extensions can derive classes from core files require_once "$IP/includes/AutoLoader.php"; @@ -46,12 +49,6 @@ require_once "$IP/includes/AutoLoader.php"; // Load up some global defines require_once "$IP/includes/Defines.php"; -// Start the profiler -$wgProfiler = []; -if ( file_exists( "$IP/StartProfiler.php" ) ) { - require "$IP/StartProfiler.php"; -} - // Load default settings require_once "$IP/includes/DefaultSettings.php"; @@ -373,9 +370,8 @@ if ( $wgRCFilterByAge ) { // Note that we allow 1 link higher than the max for things like 56 days but a 60 day link. sort( $wgRCLinkDays ); - // @codingStandardsIgnoreStart Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed + // phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall for ( $i = 0; $i < count( $wgRCLinkDays ); $i++ ) { - // @codingStandardsIgnoreEnd if ( $wgRCLinkDays[$i] >= $rcMaxAgeDays ) { $wgRCLinkDays = array_slice( $wgRCLinkDays, 0, $i + 1, false ); break; @@ -737,14 +733,22 @@ if ( !$wgDBerrorLogTZ ) { $wgDBerrorLogTZ = $wgLocaltimezone; } -// initialize the request object in $wgRequest +// Initialize the request object in $wgRequest $wgRequest = RequestContext::getMain()->getRequest(); // BackCompat -// Set user IP/agent information for causal consistency purposes +// Set user IP/agent information for causal consistency purposes. +// The cpPosIndex cookie has no prefix and is set by MediaWiki::preOutputCommit(). +$cpPosIndex = $wgRequest->getInt( 'cpPosIndex', (int)$wgRequest->getCookie( 'cpPosIndex', '' ) ); MediaWikiServices::getInstance()->getDBLoadBalancerFactory()->setRequestInfo( [ 'IPAddress' => $wgRequest->getIP(), 'UserAgent' => $wgRequest->getHeader( 'User-Agent' ), - 'ChronologyProtection' => $wgRequest->getHeader( 'ChronologyProtection' ) + 'ChronologyProtection' => $wgRequest->getHeader( 'ChronologyProtection' ), + 'ChronologyPositionIndex' => $cpPosIndex ] ); +// Make sure that caching does not compromise the consistency improvements +if ( $cpPosIndex ) { + MediaWikiServices::getInstance()->getMainWANObjectCache()->useInterimHoldOffCaching( false ); +} +unset( $cpPosIndex ); // Useful debug output if ( $wgCommandLineMode ) {