Removed LocalFile::purgeHistory method
authorAaron Schulz <aschulz@wikimedia.org>
Tue, 28 Apr 2015 00:36:02 +0000 (17:36 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Tue, 28 Apr 2015 00:36:02 +0000 (17:36 -0700)
* 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
maintenance/eraseArchivedFile.php
maintenance/purgeChangedFiles.php

index b4cced3..d368d90 100644 (file)
@@ -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();
                        }
                }
 
index 94ca604..8fdcef3 100644 (file)
@@ -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 ) {
index d21a296..b98e95f 100644 (file)
@@ -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" );
                                        }
                                }