r65543 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65542‎ | r65543 | r65544 >
Date:14:44, 26 April 2010
Author:jdpond
Status:ok
Tags:
Comment:
Modification to LocalFile::getHistory for custom repos
Hard coded OldLocalFile::getHistory now used only when oldFileFromRowFactory not declared - for backwards compatibility
Modified paths:
  • /trunk/phase3/includes/filerepo/LocalFile.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/filerepo/LocalFile.php
@@ -661,7 +661,11 @@
662662 $res = $dbr->select( $tables, $fields, $conds, __METHOD__, $opts, $join_conds );
663663 $r = array();
664664 while( $row = $dbr->fetchObject( $res ) ) {
665 - $r[] = OldLocalFile::newFromRow( $row, $this->repo );
 665+ if ( $this->repo->oldFileFromRowFactory ) {
 666+ $r[] = call_user_func( $this->repo->oldFileFromRowFactory, $row, $this->repo );
 667+ } else {
 668+ $r[] = OldLocalFile::newFromRow( $row, $this->repo );
 669+ }
666670 }
667671 if( $order == 'ASC' ) {
668672 $r = array_reverse( $r ); // make sure it ends up descending

Status & tagging log