r72331 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72330‎ | r72331 | r72332 >
Date:23:04, 3 September 2010
Author:catrope
Status:ok
Tags:
Comment:
resourceloader: Put the database query back that Trevor accidentally removed, and put the updaters back that got lost in one of the merges
Modified paths:
  • /branches/resourceloader/phase3/includes/ResourceLoaderModule.php (modified) (history)
  • /branches/resourceloader/phase3/includes/installer/MysqlUpdater.php (modified) (history)
  • /branches/resourceloader/phase3/includes/installer/SqliteUpdater.php (modified) (history)

Diff [purge]

Index: branches/resourceloader/phase3/includes/installer/MysqlUpdater.php
@@ -166,6 +166,7 @@
167167 array( 'drop_index_if_exists', 'iwlinks', 'iwl_prefix_from_title', 'patch-kill-iwl_pft.sql' ),
168168 array( 'addField', 'categorylinks', 'cl_collation', 'patch-categorylinks-better-collation.sql' ),
169169 array( 'do_collation_update' ),
 170+ array( 'addTable', 'msg_resource', 'patch-msg_resource.sql' ),
170171 array( 'addTable', 'module_deps', 'patch-module_deps.sql' ),
171172 );
172173 }
Index: branches/resourceloader/phase3/includes/installer/SqliteUpdater.php
@@ -47,6 +47,7 @@
4848 array( 'addField', 'interwiki', 'iw_api', 'patch-iw_api_and_wikiid.sql' ),
4949 array( 'drop_index_if_exists', 'iwlinks', 'iwl_prefix', 'patch-kill-iwl_prefix.sql' ),
5050 array( 'drop_index_if_exists', 'iwlinks', 'iwl_prefix_from_title', 'patch-kill-iwl_pft.sql' ),
 51+ array( 'addTable', 'msg_resource', 'patch-msg_resource.sql' ),
5152 array( 'addTable', 'module_deps', 'patch-module_deps.sql' ),
5253 );
5354 }
Index: branches/resourceloader/phase3/includes/ResourceLoaderModule.php
@@ -408,9 +408,19 @@
409409 $this->loaders,
410410 $this->getFileDependencies( $context->getSkin() )
411411 );
412 - $this->modifiedTime[$context->getHash()] = max(
413 - array_map( 'filemtime', array_map( array( __CLASS__, 'remapFilename' ), $files ) )
 412+ $filesMtime = max( array_map( 'filemtime', array_map( array( __CLASS__, 'remapFilename' ), $files ) ) );
 413+
 414+ // Get the mtime of the message blob
 415+ // TODO: This timestamp is queried a lot and queried separately for each module. Maybe it should be put in memcached?
 416+ $dbr = wfGetDb( DB_SLAVE );
 417+ $msgBlobMtime = $dbr->selectField( 'msg_resource', 'mr_timestamp', array(
 418+ 'mr_resource' => $this->getName(),
 419+ 'mr_lang' => $context->getLanguage()
 420+ ), __METHOD__
414421 );
 422+ $msgBlobMtime = $msgBlobMtime ? wfTimestamp( TS_UNIX, $msgBlobMtime ) : 0;
 423+
 424+ $this->modifiedTime[$context->getHash()] = max( $filesMtime, $msgBlobMtime );
415425 return $this->modifiedTime[$context->getHash()];
416426 }
417427

Status & tagging log