r41822 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41821‎ | r41822 | r41823 >
Date:21:42, 7 October 2008
Author:aaron
Status:old
Tags:
Comment:
Revert r41788 and make flaggedrevs do the findFile call itself
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -2790,8 +2790,8 @@
27912791 * Get an object referring to a locally registered file.
27922792 * Returns a valid placeholder object if the file does not exist.
27932793 */
2794 -function wfLocalFile( $title, $time = false ) {
2795 - return RepoGroup::singleton()->getLocalRepo()->newFile( $title, $time );
 2794+function wfLocalFile( $title ) {
 2795+ return RepoGroup::singleton()->getLocalRepo()->newFile( $title );
27962796 }
27972797
27982798 /**
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -432,7 +432,7 @@
433433 $parser->mOutput->fr_ImageSHA1Keys[$title->getDBkey()] = array();
434434 $parser->mOutput->fr_ImageSHA1Keys[$title->getDBkey()][$time] = $sha1;
435435 # Bug 15748, be lax about commons image sync status
436 - $file = $file ? $file : wfLocalFile( $title, $time ); # FIXME: would be nice not to double fetch!
 436+ $file = $file ? $file : self::getLocalFile( $title, $time ); # FIXME: would be nice not to double fetch!
437437 if( $file->exists() && $file->isLocal() && $time > $parser->mOutput->fr_newestImageTime ) {
438438 $parser->mOutput->fr_newestImageTime = $time;
439439 }
@@ -503,12 +503,13 @@
504504 $ig->mParser->mOutput->fr_ImageSHA1Keys[$nt->getDBkey()] = array();
505505 $ig->mParser->mOutput->fr_ImageSHA1Keys[$nt->getDBkey()][$time] = $sha1;
506506 # Bug 15748, be lax about commons image sync status
507 - $file = $file ? $file : wfLocalFile( $nt, $time ); # FIXME: would be nice not to double fetch!
 507+ $file = $file ? $file : self::getLocalFile( $nt, $time ); # FIXME: would be nice not to double fetch!
508508 if( $file->exists() && $file->isLocal() && $time > $ig->mParser->mOutput->fr_newestImageTime ) {
509509 $ig->mParser->mOutput->fr_newestImageTime = $time;
510510 }
511511 return true;
512512 }
 513+
513514 /**
514515 * Insert image timestamps/SHA-1 keys into parser output
515516 */
@@ -570,6 +571,10 @@
571572 return true;
572573 }
573574
 575+ protected static function getLocalFile( $title, $time ) {
 576+ return RepoGroup::singleton()->getLocalRepo()->findFile( $title, $time );
 577+ }
 578+
574579 /**
575580 * Don't let users vandalize pages by moving them
576581 */

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r41788Add handy $time parameter to wfLocalFile()aaron00:30, 7 October 2008

Status & tagging log