diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2015-06-04 07:31:04 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2015-06-04 07:58:39 +0200 |
commit | f6d65e533c62f6deb21342d4901ece24497b433e (patch) | |
tree | f28adf0362d14bcd448f7b65a7aaf38650f923aa /includes/filerepo/file/OldLocalFile.php | |
parent | c27b2e832fe25651ef2410fae85b41072aae7519 (diff) |
Update to MediaWiki 1.25.1
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__ ); } /** |