Index: branches/resourceloader/phase3/includes/installer/MysqlUpdater.php |
— | — | @@ -166,6 +166,7 @@ |
167 | 167 | array( 'drop_index_if_exists', 'iwlinks', 'iwl_prefix_from_title', 'patch-kill-iwl_pft.sql' ), |
168 | 168 | array( 'addField', 'categorylinks', 'cl_collation', 'patch-categorylinks-better-collation.sql' ), |
169 | 169 | array( 'do_collation_update' ), |
| 170 | + array( 'addTable', 'msg_resource', 'patch-msg_resource.sql' ), |
170 | 171 | array( 'addTable', 'module_deps', 'patch-module_deps.sql' ), |
171 | 172 | ); |
172 | 173 | } |
Index: branches/resourceloader/phase3/includes/installer/SqliteUpdater.php |
— | — | @@ -47,6 +47,7 @@ |
48 | 48 | array( 'addField', 'interwiki', 'iw_api', 'patch-iw_api_and_wikiid.sql' ), |
49 | 49 | array( 'drop_index_if_exists', 'iwlinks', 'iwl_prefix', 'patch-kill-iwl_prefix.sql' ), |
50 | 50 | array( 'drop_index_if_exists', 'iwlinks', 'iwl_prefix_from_title', 'patch-kill-iwl_pft.sql' ), |
| 51 | + array( 'addTable', 'msg_resource', 'patch-msg_resource.sql' ), |
51 | 52 | array( 'addTable', 'module_deps', 'patch-module_deps.sql' ), |
52 | 53 | ); |
53 | 54 | } |
Index: branches/resourceloader/phase3/includes/ResourceLoaderModule.php |
— | — | @@ -408,9 +408,19 @@ |
409 | 409 | $this->loaders, |
410 | 410 | $this->getFileDependencies( $context->getSkin() ) |
411 | 411 | ); |
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__ |
414 | 421 | ); |
| 422 | + $msgBlobMtime = $msgBlobMtime ? wfTimestamp( TS_UNIX, $msgBlobMtime ) : 0; |
| 423 | + |
| 424 | + $this->modifiedTime[$context->getHash()] = max( $filesMtime, $msgBlobMtime ); |
415 | 425 | return $this->modifiedTime[$context->getHash()]; |
416 | 426 | } |
417 | 427 | |