Merge "Replace dev.w3.org with more permanent or stable urls"
[lhc/web/wiklou.git] / includes / MessageBlobStore.php
index 30d4fda..6f7e8e5 100644 (file)
@@ -56,9 +56,7 @@ class MessageBlobStore {
         * @return array An array mapping module names to message blobs
         */
        public function get( ResourceLoader $resourceLoader, $modules, $lang ) {
-               wfProfileIn( __METHOD__ );
                if ( !count( $modules ) ) {
-                       wfProfileOut( __METHOD__ );
                        return array();
                }
                // Try getting from the DB first
@@ -73,7 +71,6 @@ class MessageBlobStore {
                        }
                }
 
-               wfProfileOut( __METHOD__ );
                return $blobs;
        }
 
@@ -345,8 +342,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 +359,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 {