From 3aeed2d2dc43f7b123855617c27611feb491c433 Mon Sep 17 00:00:00 2001 From: Jan Gerber Date: Tue, 27 Nov 2012 05:41:56 +0000 Subject: [PATCH] Purge videos from squid on action=purge While we don't want to re-encode videos on purge, they should still be removed from squid; compute the list of all urls before extensions can filter it to remove files that should not be deleted from the file backend. Change-Id: Id837843b5a203e49a8594439ce3620da9b3c7b6a --- includes/filerepo/file/LocalFile.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index 3525594dd2..a9678b7b20 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -771,8 +771,16 @@ class LocalFile extends File { // Delete thumbnails $files = $this->getThumbnails(); + // Always purge all files from squid regardless of handler filters + if ( $wgUseSquid ) { + $urls = array(); + foreach( $files as $file ) { + $urls[] = $this->getThumbUrl( $file ); + } + array_shift( $urls ); // don't purge directory + } - // Give media handler a chance to filter the purge list + // Give media handler a chance to filter the file purge list if ( !empty( $options['forThumbRefresh'] ) ) { $handler = $this->getHandler(); if ( $handler ) { @@ -788,10 +796,6 @@ class LocalFile extends File { // Purge the squid if ( $wgUseSquid ) { - $urls = array(); - foreach( $files as $file ) { - $urls[] = $this->getThumbUrl( $file ); - } SquidUpdate::purge( $urls ); } -- 2.20.1