Changed new LocalFilePurgeThumbnails hook arguments and updated wmf/swift.php to...
authorAaron Schulz <aaron@users.mediawiki.org>
Tue, 15 Nov 2011 02:20:08 +0000 (02:20 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Tue, 15 Nov 2011 02:20:08 +0000 (02:20 +0000)
docs/hooks.txt
includes/filerepo/LocalFile.php

index 4b4c666..9ff4bda 100644 (file)
@@ -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
index a527236..8b66f81 100644 (file)
@@ -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 ) {