From: Kunal Mehta Date: Sat, 23 Aug 2014 07:58:07 +0000 (-0700) Subject: MessageBlobStore: Use Config instead of globals X-Git-Tag: 1.31.0-rc.0~14287^2 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=4e94a67445a3550fad2619c2c3b7eff8853f9c16;p=lhc%2Fweb%2Fwiklou.git MessageBlobStore: Use Config instead of globals Change-Id: I458cc74bac1bff8edab6ad537a3a999ede5706ed --- diff --git a/includes/MessageBlobStore.php b/includes/MessageBlobStore.php index 30d4fdab75..e3b4dbe8fe 100644 --- a/includes/MessageBlobStore.php +++ b/includes/MessageBlobStore.php @@ -345,8 +345,7 @@ class MessageBlobStore { * @return array Array mapping module names to blobs */ private function getFromDB( ResourceLoader $resourceLoader, $modules, $lang ) { - global $wgCacheEpoch; - + $config = $resourceLoader->getConfig(); $retval = array(); $dbr = wfGetDB( DB_SLAVE ); $res = $dbr->select( 'msg_resource', @@ -363,11 +362,11 @@ class MessageBlobStore { } // Update the module's blobs if the set of messages changed or if the blob is - // older than $wgCacheEpoch + // older than the CacheEpoch setting $keys = array_keys( FormatJson::decode( $row->mr_blob, true ) ); $values = array_values( array_unique( $module->getMessages() ) ); if ( $keys !== $values - || wfTimestamp( TS_MW, $row->mr_timestamp ) <= $wgCacheEpoch + || wfTimestamp( TS_MW, $row->mr_timestamp ) <= $config->get( 'CacheEpoch' ) ) { $retval[$row->mr_resource] = $this->updateModule( $row->mr_resource, $module, $lang ); } else {