From: Jan Gerber Date: Tue, 27 Nov 2012 05:41:56 +0000 (+0000) Subject: Purge videos from squid on action=purge X-Git-Tag: 1.31.0-rc.0~21409^2 X-Git-Url: http://git.cyclocoop.org/data/Luca_Pacioli_%28Gemaelde%29.jpeg?a=commitdiff_plain;h=3aeed2d2dc43f7b123855617c27611feb491c433;p=lhc%2Fweb%2Fwiklou.git 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 --- 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 ); }