From 1404c6ca2d41cfd3a6c8cbf358849e1a52cc1c53 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 21 May 2015 11:23:19 -0700 Subject: [PATCH] Avoid calling load() in LocalFile::invalidateCache; not needed Change-Id: I1e2d61722a18e4046bdf7c375ea9c1dbbea4a157 --- includes/filerepo/file/File.php | 3 ++- includes/filerepo/file/LocalFile.php | 5 +---- 2 files changed, 3 insertions(+), 5 deletions(-) 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 ); } /** -- 2.20.1