Index: trunk/phase3/includes/filerepo/LocalFile.php |
— | — | @@ -674,12 +674,12 @@ |
675 | 675 | /** |
676 | 676 | * Delete all previously generated thumbnails, refresh metadata in memcached and purge the squid |
677 | 677 | */ |
678 | | - function purgeCache( $options = array() ) { |
| 678 | + function purgeCache() { |
679 | 679 | // Refresh metadata cache |
680 | 680 | $this->purgeMetadataCache(); |
681 | 681 | |
682 | 682 | // Delete thumbnails |
683 | | - $this->purgeThumbnails( $options ); |
| 683 | + $this->purgeThumbnails(); |
684 | 684 | |
685 | 685 | // Purge squid cache for this file |
686 | 686 | SquidUpdate::purge( array( $this->getURL() ) ); |
— | — | @@ -722,18 +722,11 @@ |
723 | 723 | /** |
724 | 724 | * Delete cached transformed files for the current version only. |
725 | 725 | */ |
726 | | - function purgeThumbnails( $options = array() ) { |
| 726 | + function purgeThumbnails() { |
727 | 727 | global $wgUseSquid; |
728 | | - |
729 | | - // Get a list of thumbnails and URLs |
| 728 | + |
| 729 | + // Delete thumbnails |
730 | 730 | $files = $this->getThumbnails(); |
731 | | - |
732 | | - // Give media handler a chance to filter the purge list |
733 | | - $handler = $this->getHandler(); |
734 | | - if ( $handler ) { |
735 | | - $handler->filterThumbnailPurgeList( $files, $options ); |
736 | | - } |
737 | | - |
738 | 731 | $dir = array_shift( $files ); |
739 | 732 | $this->purgeThumbList( $dir, $files ); |
740 | 733 | |
— | — | @@ -756,16 +749,8 @@ |
757 | 750 | * @param $files array of strings: relative filenames (to $dir) |
758 | 751 | */ |
759 | 752 | protected function purgeThumbList($dir, $files) { |
760 | | - global $wgExcludeFromThumbnailPurge; |
761 | | - |
762 | 753 | wfDebug( __METHOD__ . ": " . var_export( $files, true ) . "\n" ); |
763 | 754 | foreach ( $files as $file ) { |
764 | | - // Only remove files not in the $wgExcludeFromThumbnailPurge configuration variable |
765 | | - $ext = pathinfo( "$dir/$file", PATHINFO_EXTENSION ); |
766 | | - if ( in_array( $ext, $wgExcludeFromThumbnailPurge ) ) { |
767 | | - continue; |
768 | | - } |
769 | | - |
770 | 755 | # Check that the base file name is part of the thumb name |
771 | 756 | # This is a basic sanity check to avoid erasing unrelated directories |
772 | 757 | if ( strpos( $file, $this->getName() ) !== false ) { |
Index: trunk/phase3/includes/filerepo/File.php |
— | — | @@ -811,9 +811,8 @@ |
812 | 812 | * Purge shared caches such as thumbnails and DB data caching |
813 | 813 | * STUB |
814 | 814 | * Overridden by LocalFile |
815 | | - * @param array $options Array with options, currently undefined |
816 | 815 | */ |
817 | | - function purgeCache( $options = array() ) {} |
| 816 | + function purgeCache() {} |
818 | 817 | |
819 | 818 | /** |
820 | 819 | * Purge the file description page, but don't go after |
Index: trunk/phase3/includes/filerepo/ForeignAPIFile.php |
— | — | @@ -209,11 +209,8 @@ |
210 | 210 | return $files; |
211 | 211 | } |
212 | 212 | |
213 | | - /** |
214 | | - * @see File::purgeCache() |
215 | | - */ |
216 | | - function purgeCache( $options = array() ) { |
217 | | - $this->purgeThumbnails( $options ); |
| 213 | + function purgeCache() { |
| 214 | + $this->purgeThumbnails(); |
218 | 215 | $this->purgeDescriptionPage(); |
219 | 216 | } |
220 | 217 | |
— | — | @@ -224,18 +221,11 @@ |
225 | 222 | $wgMemc->delete( $key ); |
226 | 223 | } |
227 | 224 | |
228 | | - function purgeThumbnails( $options = array() ) { |
| 225 | + function purgeThumbnails() { |
229 | 226 | global $wgMemc; |
230 | 227 | $key = $this->repo->getLocalCacheKey( 'ForeignAPIRepo', 'ThumbUrl', $this->getName() ); |
231 | 228 | $wgMemc->delete( $key ); |
232 | | - |
233 | 229 | $files = $this->getThumbnails(); |
234 | | - // Give media handler a chance to filter the purge list |
235 | | - $handler = $this->getHandler(); |
236 | | - if ( $handler ) { |
237 | | - $handler->filterThumbnailPurgeList( $files, $options ); |
238 | | - } |
239 | | - |
240 | 230 | $dir = $this->getThumbPath( $this->getName() ); |
241 | 231 | foreach ( $files as $file ) { |
242 | 232 | unlink( $dir . $file ); |
Index: trunk/phase3/includes/media/Generic.php |
— | — | @@ -504,16 +504,6 @@ |
505 | 505 | } |
506 | 506 | return false; |
507 | 507 | } |
508 | | - |
509 | | - /** |
510 | | - * Remove files from the purge list |
511 | | - * |
512 | | - * @param array $files |
513 | | - * @param array $options |
514 | | - */ |
515 | | - public function filterThumbnailPurgeList( &$files, $options ) { |
516 | | - // Do nothing |
517 | | - } |
518 | 508 | } |
519 | 509 | |
520 | 510 | /** |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -4837,13 +4837,7 @@ |
4838 | 4838 | ); |
4839 | 4839 | |
4840 | 4840 | /** |
4841 | | - * Extensions of "thumbnails" that are very expensive to regenerate and should be |
4842 | | - * excluded from normal action=purge thumbnail removal. |
4843 | | - */ |
4844 | | -$wgExcludeFromThumbnailPurge = array(); |
4845 | 4841 | |
4846 | | -/** |
4847 | | - |
4848 | 4842 | * Jobs that must be explicitly requested, i.e. aren't run by job runners unless special flags are set. |
4849 | 4843 | * |
4850 | 4844 | * These can be: |