Index: trunk/phase3/docs/hooks.txt |
— | — | @@ -1191,7 +1191,7 @@ |
1192 | 1192 | |
1193 | 1193 | 'LocalFilePurgeThumbnails': called before thumbnails for a local file a purged |
1194 | 1194 | $file: the File object |
1195 | | -$type: either "current" or "archive" |
| 1195 | +$archiveName: name of an old file version or false if it's the current one |
1196 | 1196 | |
1197 | 1197 | 'LocalisationCacheRecache': Called when loading the localisation data into cache |
1198 | 1198 | $cache: The LocalisationCache object |
Index: trunk/phase3/includes/filerepo/LocalFile.php |
— | — | @@ -687,7 +687,7 @@ |
688 | 688 | } |
689 | 689 | |
690 | 690 | /** |
691 | | - * Delete cached transformed files for archived files |
| 691 | + * Delete cached transformed files for an archived version only. |
692 | 692 | * @param $archiveName string name of the archived file |
693 | 693 | */ |
694 | 694 | function purgeOldThumbnails( $archiveName ) { |
— | — | @@ -707,7 +707,7 @@ |
708 | 708 | wfRestoreWarnings(); |
709 | 709 | |
710 | 710 | // Purge any custom thumbnail caches |
711 | | - wfRunHooks( 'LocalFilePurgeThumbnails', array( $this, 'archive' ) ); |
| 711 | + wfRunHooks( 'LocalFilePurgeThumbnails', array( $this, $archiveName ) ); |
712 | 712 | |
713 | 713 | // Purge the squid |
714 | 714 | if ( $wgUseSquid ) { |
— | — | @@ -732,7 +732,7 @@ |
733 | 733 | $this->purgeThumbList( $dir, $files ); |
734 | 734 | |
735 | 735 | // Purge any custom thumbnail caches |
736 | | - wfRunHooks( 'LocalFilePurgeThumbnails', array( $this, 'current' ) ); |
| 736 | + wfRunHooks( 'LocalFilePurgeThumbnails', array( $this, false ) ); |
737 | 737 | |
738 | 738 | // Purge the squid |
739 | 739 | if ( $wgUseSquid ) { |
Index: trunk/extensions/SwiftMedia/wmf/swift.php |
— | — | @@ -18,18 +18,16 @@ |
19 | 19 | * to CommonSettings.php which includes this file and calls this function. |
20 | 20 | * |
21 | 21 | * @param $file File |
22 | | - * @param $type string "current" or "old" |
| 22 | + * @param $archiveName string|false |
23 | 23 | * @return true |
24 | 24 | */ |
25 | | -function wmfPurgeBackendThumbCache( File $file, $type ) { |
| 25 | +function wmfPurgeBackendThumbCache( File $file, $archiveName ) { |
26 | 26 | global $site, $lang; // CommonSettings.php |
27 | 27 | |
28 | | - if ( $type === 'current' ) { |
29 | | - $thumbRel = $file->getRel(); |
30 | | - } elseif ( $type === 'archive' ) { |
31 | | - $thumbRel = $file->getArchiveThumbRel(); |
| 28 | + if ( $archiveName !== false ) { |
| 29 | + $thumbRel = $file->getArchiveThumbRel( $archiveName ); // old version |
32 | 30 | } else { |
33 | | - return true; // sanity |
| 31 | + $thumbRel = $file->getRel(); // current version |
34 | 32 | } |
35 | 33 | |
36 | 34 | $container = wmfGetSwiftThumbContainer( $site, $lang ); |