Merge "resourceloader: Remove deprecated minifier config vars"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 30 Nov 2017 23:32:51 +0000 (23:32 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 30 Nov 2017 23:32:51 +0000 (23:32 +0000)
includes/Setup.php
includes/libs/rdbms/lbfactory/ILBFactory.php
includes/libs/rdbms/lbfactory/LBFactory.php

index 4c281b1..081ea68 100644 (file)
@@ -734,13 +734,18 @@ 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
 MediaWikiServices::getInstance()->getDBLoadBalancerFactory()->setRequestInfo( [
        'IPAddress' => $wgRequest->getIP(),
        'UserAgent' => $wgRequest->getHeader( 'User-Agent' ),
-       'ChronologyProtection' => $wgRequest->getHeader( 'ChronologyProtection' )
+       'ChronologyProtection' => $wgRequest->getHeader( 'ChronologyProtection' ),
+       // The cpPosTime cookie has no prefix and is set by MediaWiki::preOutputCommit()
+       'ChronologyPositionTime' => $wgRequest->getFloat(
+               'cpPosTime',
+               $wgRequest->getCookie( 'cpPosTime', '' )
+       )
 ] );
 
 // Useful debug output
index f6d080e..697af0e 100644 (file)
@@ -319,6 +319,7 @@ interface ILBFactory {
         *   - IPAddress : IP address
         *   - UserAgent : User-Agent HTTP header
         *   - ChronologyProtection : cookie/header value specifying ChronologyProtector usage
+        *   - ChronologyPositionTime: timestamp used to get up-to-date DB positions for the agent
         */
        public function setRequestInfo( array $info );
 }
index c891fb6..ef716b6 100644 (file)
@@ -115,7 +115,8 @@ abstract class LBFactory implements ILBFactory {
                $this->requestInfo = [
                        'IPAddress' => isset( $_SERVER[ 'REMOTE_ADDR' ] ) ? $_SERVER[ 'REMOTE_ADDR' ] : '',
                        'UserAgent' => isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : '',
-                       'ChronologyProtection' => 'true'
+                       'ChronologyProtection' => 'true',
+                       'ChronologyPositionTime' => isset( $_GET['cpPosTime'] ) ? $_GET['cpPosTime'] : null
                ];
 
                $this->cliMode = isset( $conf['cliMode'] ) ? $conf['cliMode'] : PHP_SAPI === 'cli';
@@ -440,7 +441,7 @@ abstract class LBFactory implements ILBFactory {
                                'ip' => $this->requestInfo['IPAddress'],
                                'agent' => $this->requestInfo['UserAgent'],
                        ],
-                       isset( $_GET['cpPosTime'] ) ? $_GET['cpPosTime'] : null
+                       $this->requestInfo['ChronologyPositionTime']
                );
                $this->chronProt->setLogger( $this->replLogger );