From: Aaron Schulz Date: Thu, 21 May 2015 18:23:19 +0000 (-0700) Subject: Avoid calling load() in LocalFile::invalidateCache; not needed X-Git-Tag: 1.31.0-rc.0~11336^2 X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=commitdiff_plain;h=1404c6ca2d41cfd3a6c8cbf358849e1a52cc1c53;p=lhc%2Fweb%2Fwiklou.git Avoid calling load() in LocalFile::invalidateCache; not needed Change-Id: I1e2d61722a18e4046bdf7c375ea9c1dbbea4a157 --- diff --git a/includes/filerepo/file/File.php b/includes/filerepo/file/File.php index 6edd6fccca..eb50a12924 100644 --- a/includes/filerepo/file/File.php +++ b/includes/filerepo/file/File.php @@ -163,7 +163,8 @@ abstract class File implements IDBAccessObject { * @param FileRepo|bool $repo */ function __construct( $title, $repo ) { - if ( $title !== false ) { // subclasses may not use MW titles + // Some subclasses do not use $title, but set name/title some other way + if ( $title !== false ) { $title = self::normalizeTitle( $title, 'exception' ); } $this->title = $title; diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index fe42c2d81c..b763c8d899 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -316,15 +316,12 @@ class LocalFile extends File { * Purge the file object/metadata cache */ function invalidateCache() { - $this->load(); - $key = $this->getCacheKey(); if ( !$key ) { return; } - $cache = ObjectCache::getMainWANInstance(); - $cache->delete( $key ); + ObjectCache::getMainWANInstance()->delete( $key ); } /**