X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FSetup.php;h=d6f4b2fe4c0b28cf9ee57e240dd0f0ad83ec8fa1;hb=847bc2b8d7756c36551a768f5cf0d36bc50705b6;hp=e4396ba9261c0af617032480e1f946d5f2f78cf4;hpb=143af5c0bd90d6f584045ab36dbf5a5d918fd979;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Setup.php b/includes/Setup.php index e4396ba926..d6f4b2fe4c 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"; @@ -737,14 +734,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 cpPosTime cookie has no prefix and is set by MediaWiki::preOutputCommit(). +$cpPosTime = $wgRequest->getFloat( 'cpPosTime', $wgRequest->getCookie( 'cpPosTime', '' ) ); MediaWikiServices::getInstance()->getDBLoadBalancerFactory()->setRequestInfo( [ 'IPAddress' => $wgRequest->getIP(), 'UserAgent' => $wgRequest->getHeader( 'User-Agent' ), - 'ChronologyProtection' => $wgRequest->getHeader( 'ChronologyProtection' ) + 'ChronologyProtection' => $wgRequest->getHeader( 'ChronologyProtection' ), + 'ChronologyPositionTime' => $cpPosTime ] ); +// Make sure that caching does not compromise the consistency improvements +if ( $cpPosTime ) { + MediaWikiServices::getInstance()->getMainWANObjectCache()->useInterimHoldOffCaching( false ); +} +unset( $cpPosTime ); // Useful debug output if ( $wgCommandLineMode ) {