diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:30:02 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:30:02 -0400 |
commit | 1de335ad3f395ca6861085393ba366a9e3fb4a0d (patch) | |
tree | f1fdd326034e05177596851be6a7127615d81498 /includes/filerepo/file/OldLocalFile.php | |
parent | 9c75fa8ff6d4d38ef552c00fef5969fb154765e8 (diff) | |
parent | f6d65e533c62f6deb21342d4901ece24497b433e (diff) |
Merge commit 'f6d65'
# Conflicts:
# skins/ArchLinux/ArchLinux.php
Diffstat (limited to 'includes/filerepo/file/OldLocalFile.php')
-rw-r--r-- | includes/filerepo/file/OldLocalFile.php | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/includes/filerepo/file/OldLocalFile.php b/includes/filerepo/file/OldLocalFile.php index 710058fb..fd92e11a 100644 --- a/includes/filerepo/file/OldLocalFile.php +++ b/includes/filerepo/file/OldLocalFile.php @@ -175,11 +175,12 @@ class OldLocalFile extends LocalFile { } function loadFromDB( $flags = 0 ) { - wfProfileIn( __METHOD__ ); - $this->dataLoaded = true; - $dbr = $this->repo->getSlaveDB(); + $dbr = ( $flags & self::READ_LATEST ) + ? $this->repo->getMasterDB() + : $this->repo->getSlaveDB(); + $conds = array( 'oi_name' => $this->getName() ); if ( is_null( $this->requestedTime ) ) { $conds['oi_archive_name'] = $this->archive_name; @@ -194,14 +195,12 @@ class OldLocalFile extends LocalFile { $this->fileExists = false; } - wfProfileOut( __METHOD__ ); } /** * Load lazy file metadata from the DB */ protected function loadExtraFromDB() { - wfProfileIn( __METHOD__ ); $this->extraDataLoaded = true; $dbr = $this->repo->getSlaveDB(); @@ -226,11 +225,9 @@ class OldLocalFile extends LocalFile { $this->$name = $value; } } else { - wfProfileOut( __METHOD__ ); throw new MWException( "Could not find data for image '{$this->archive_name}'." ); } - wfProfileOut( __METHOD__ ); } /** @@ -260,13 +257,11 @@ class OldLocalFile extends LocalFile { } function upgradeRow() { - wfProfileIn( __METHOD__ ); $this->loadFromFile(); # Don't destroy file info of missing files if ( !$this->fileExists ) { wfDebug( __METHOD__ . ": file does not exist, aborting\n" ); - wfProfileOut( __METHOD__ ); return; } @@ -291,7 +286,6 @@ class OldLocalFile extends LocalFile { 'oi_archive_name' => $this->archive_name ), __METHOD__ ); - wfProfileOut( __METHOD__ ); } /** |