if ( $this->dataLoaded ) {
return true;
}
- $conds = array();
+ $conds = [];
if ( $this->id > 0 ) {
$conds['fa_id'] = $this->id;
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?
* @return array
*/
static function selectFields() {
- return array(
+ return [
'fa_id',
'fa_name',
'fa_archive_name',
'fa_deleted',
'fa_deleted_timestamp', /* Used by LocalFileRestoreBatch */
'fa_sha1',
- );
+ ];
}
/**