Modification to LocalFile::getHistory for custom repos
authorJack D. Pond <jdpond@users.mediawiki.org>
Mon, 26 Apr 2010 14:44:54 +0000 (14:44 +0000)
committerJack D. Pond <jdpond@users.mediawiki.org>
Mon, 26 Apr 2010 14:44:54 +0000 (14:44 +0000)
Hard coded OldLocalFile::getHistory now used only when oldFileFromRowFactory not declared - for backwards compatibility

includes/filerepo/LocalFile.php

index d7364a5..c321d91 100644 (file)
@@ -661,7 +661,11 @@ class LocalFile extends File {
                $res = $dbr->select( $tables, $fields, $conds, __METHOD__, $opts, $join_conds );
                $r = array();
                while( $row = $dbr->fetchObject( $res ) ) {
-                       $r[] = OldLocalFile::newFromRow( $row, $this->repo );
+                       if ( $this->repo->oldFileFromRowFactory ) {
+                               $r[] = call_user_func( $this->repo->oldFileFromRowFactory, $row, $this->repo );
+                       } else {
+                               $r[] = OldLocalFile::newFromRow( $row, $this->repo );
+                       }
                }
                if( $order == 'ASC' ) {
                        $r = array_reverse( $r ); // make sure it ends up descending