'uploadFromUrl' => 'UploadFromUrlJob',
);
+/**
+ * Extensions of "thumbnails" that are very expensive to regenerate and should be
+ * excluded from normal action=purge thumbnail removal.
+ */
+$wgExcludeFromThumbnailPurge = array();
+
/**
* Additional functions to be performed with updateSpecialPages.
* Expensive Querypages are already updated.
* Delete cached transformed files
*/
function purgeThumbnails() {
- global $wgUseSquid;
+ global $wgUseSquid, $wgExcludeFromThumbnailPurge;
// Delete thumbnails
$files = $this->getThumbnails();
$urls = array();
foreach ( $files as $file ) {
+ // Only remove files not in the $wgExcludeFromThumbnailPurge configuration variable
+ $ext = pathinfo( "$dir/$file", PATHINFO_EXTENSION );
+ if ( in_array( $ext, $wgExcludeFromThumbnailPurge ) ) {
+ continue;
+ }
+
# Check that the base file name is part of the thumb name
# This is a basic sanity check to avoid erasing unrelated directories
if ( strpos( $file, $this->getName() ) !== false ) {