From f00af516abf9769045ae97695b1a1a2cbd9d58e6 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 15 Nov 2011 02:20:08 +0000 Subject: [PATCH] Changed new LocalFilePurgeThumbnails hook arguments and updated wmf/swift.php to actually work for archived file thumbs. --- docs/hooks.txt | 2 +- includes/filerepo/LocalFile.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/hooks.txt b/docs/hooks.txt index 4b4c666bc3..9ff4bdad72 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -1191,7 +1191,7 @@ $join_conds: JOIN conditions 'LocalFilePurgeThumbnails': called before thumbnails for a local file a purged $file: the File object -$type: either "current" or "archive" +$archiveName: name of an old file version or false if it's the current one 'LocalisationCacheRecache': Called when loading the localisation data into cache $cache: The LocalisationCache object diff --git a/includes/filerepo/LocalFile.php b/includes/filerepo/LocalFile.php index a5272361a2..8b66f81215 100644 --- a/includes/filerepo/LocalFile.php +++ b/includes/filerepo/LocalFile.php @@ -687,7 +687,7 @@ class LocalFile extends File { } /** - * Delete cached transformed files for archived files + * Delete cached transformed files for an archived version only. * @param $archiveName string name of the archived file */ function purgeOldThumbnails( $archiveName ) { @@ -707,7 +707,7 @@ class LocalFile extends File { wfRestoreWarnings(); // Purge any custom thumbnail caches - wfRunHooks( 'LocalFilePurgeThumbnails', array( $this, 'archive' ) ); + wfRunHooks( 'LocalFilePurgeThumbnails', array( $this, $archiveName ) ); // Purge the squid if ( $wgUseSquid ) { @@ -732,7 +732,7 @@ class LocalFile extends File { $this->purgeThumbList( $dir, $files ); // Purge any custom thumbnail caches - wfRunHooks( 'LocalFilePurgeThumbnails', array( $this, 'current' ) ); + wfRunHooks( 'LocalFilePurgeThumbnails', array( $this, false ) ); // Purge the squid if ( $wgUseSquid ) { -- 2.20.1