Avoid calling oldFileFromRowFactory field directly
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 29 Nov 2013 16:47:43 +0000 (08:47 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Mon, 2 Dec 2013 18:47:24 +0000 (10:47 -0800)
Change-Id: Ibbd5a8baa27015eec443349a67edc57ede5d174d

includes/filerepo/LocalRepo.php
includes/filerepo/file/LocalFile.php

index a410eed..965f677 100644 (file)
  * @ingroup FileRepo
  */
 class LocalRepo extends FileRepo {
-       public $oldFileFromRowFactory = array( 'OldLocalFile', 'newFromRow' );
-
        protected $fileFactory = array( 'LocalFile', 'newFromTitle' );
        protected $fileFactoryKey = array( 'LocalFile', 'newFromKey' );
        protected $fileFromRowFactory = array( 'LocalFile', 'newFromRow' );
+       protected $oldFileFromRowFactory = array( 'OldLocalFile', 'newFromRow' );
        protected $oldFileFactory = array( 'OldLocalFile', 'newFromTitle' );
        protected $oldFileFactoryKey = array( 'OldLocalFile', 'newFromKey' );
 
index 3c15449..c6ea79f 100644 (file)
@@ -994,11 +994,7 @@ class LocalFile extends File {
                $r = array();
 
                foreach ( $res as $row ) {
-                       if ( $this->repo->oldFileFromRowFactory ) {
-                               $r[] = call_user_func( $this->repo->oldFileFromRowFactory, $row, $this->repo );
-                       } else {
-                               $r[] = OldLocalFile::newFromRow( $row, $this->repo );
-                       }
+                       $r[] = $this->repo->newFileFromRow( $row );
                }
 
                if ( $order == 'ASC' ) {