Merge "Convert Special:DeletedContributions to use OOUI."
[lhc/web/wiklou.git] / includes / filerepo / file / ArchivedFile.php
index 1aec446..921e129 100644 (file)
@@ -155,7 +155,7 @@ class ArchivedFile {
                if ( $this->dataLoaded ) {
                        return true;
                }
-               $conds = array();
+               $conds = [];
 
                if ( $this->id > 0 ) {
                        $conds['fa_id'] = $this->id;
@@ -177,13 +177,13 @@ class ArchivedFile {
 
                if ( !$this->title || $this->title->getNamespace() == NS_FILE ) {
                        $this->dataLoaded = true; // set it here, to have also true on miss
-                       $dbr = wfGetDB( DB_SLAVE );
+                       $dbr = wfGetDB( DB_REPLICA );
                        $row = $dbr->selectRow(
                                'filearchive',
                                self::selectFields(),
                                $conds,
                                __METHOD__,
-                               array( 'ORDER BY' => 'fa_timestamp DESC' )
+                               [ 'ORDER BY' => 'fa_timestamp DESC' ]
                        );
                        if ( !$row ) {
                                // this revision does not exist?
@@ -218,7 +218,7 @@ class ArchivedFile {
         * @return array
         */
        static function selectFields() {
-               return array(
+               return [
                        'fa_id',
                        'fa_name',
                        'fa_archive_name',
@@ -239,7 +239,7 @@ class ArchivedFile {
                        'fa_deleted',
                        'fa_deleted_timestamp', /* Used by LocalFileRestoreBatch */
                        'fa_sha1',
-               );
+               ];
        }
 
        /**
@@ -425,6 +425,7 @@ class ArchivedFile {
         */
        function pageCount() {
                if ( !isset( $this->pageCount ) ) {
+                       // @FIXME: callers expect File objects
                        if ( $this->getHandler() && $this->handler->isMultiPage( $this ) ) {
                                $this->pageCount = $this->handler->pageCount( $this );
                        } else {