From c518eaf0e05bda3268bcc197d85a3c3a4605ee39 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 27 Apr 2015 17:36:02 -0700 Subject: [PATCH] Removed LocalFile::purgeHistory method * This just purges an unused key as OldLocalFile::getCacheKey simply returns false (rather than a key with "oldfile" in it) Change-Id: Ic7dda9bf192803a75eaa9bd3bb5a145ad1409dd2 --- includes/filerepo/file/LocalFile.php | 19 ------------------- maintenance/eraseArchivedFile.php | 1 - maintenance/purgeChangedFiles.php | 2 -- 3 files changed, 22 deletions(-) diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index b4cced385b..d368d901e5 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -844,23 +844,6 @@ class LocalFile extends File { function purgeMetadataCache() { $this->loadFromDB( File::READ_LATEST ); $this->saveToCache(); - $this->purgeHistory(); - } - - /** - * Purge the shared history (OldLocalFile) cache. - * - * @note This used to purge old thumbnails as well. - */ - function purgeHistory() { - global $wgMemc; - - $hashedName = md5( $this->getName() ); - $oldKey = $this->repo->getSharedCacheKey( 'oldfile', $hashedName ); - - if ( $oldKey ) { - $wgMemc->delete( $oldKey ); - } } /** @@ -1667,7 +1650,6 @@ class LocalFile extends File { $this->purgeOldThumbnails( $archiveName ); if ( $status->isOK() ) { $this->purgeDescription(); - $this->purgeHistory(); } if ( $wgUseSquid ) { @@ -2565,7 +2547,6 @@ class LocalFileRestoreBatch { } else { wfDebug( __METHOD__ . " restored {$status->successCount} as archived versions\n" ); $this->file->purgeDescription(); - $this->file->purgeHistory(); } } diff --git a/maintenance/eraseArchivedFile.php b/maintenance/eraseArchivedFile.php index 94ca604de9..8fdcef3ab4 100644 --- a/maintenance/eraseArchivedFile.php +++ b/maintenance/eraseArchivedFile.php @@ -73,7 +73,6 @@ class EraseArchivedFile extends Maintenance { $this->output( "Purging all thumbnails for file '$filename'..." ); $file->purgeCache(); - $file->purgeHistory(); $this->output( "done.\n" ); if ( $afile instanceof ArchivedFile ) { diff --git a/maintenance/purgeChangedFiles.php b/maintenance/purgeChangedFiles.php index d21a296d70..b98e95f4b6 100644 --- a/maintenance/purgeChangedFiles.php +++ b/maintenance/purgeChangedFiles.php @@ -166,7 +166,6 @@ class PurgeChangedFiles extends Maintenance { // Purge current version and any versions in oldimage table $file->purgeCache(); - $file->purgeHistory(); if ( $logType === 'delete' ) { // If there is an orphaned storage file... delete it @@ -191,7 +190,6 @@ class PurgeChangedFiles extends Maintenance { $target = $params['4::target']; $targetFile = $repo->newFile( Title::makeTitle( NS_FILE, $target ) ); $targetFile->purgeCache(); - $targetFile->purgeHistory(); $this->verbose( "Purged file {$target}; move target @{$row->log_timestamp}.\n" ); } } -- 2.20.1