Purging of scaled images when thumbnail is regenerated. Depends on visiting the page...
authorGabriel Wicke <gwicke@users.mediawiki.org>
Fri, 20 Feb 2004 18:37:55 +0000 (18:37 +0000)
committerGabriel Wicke <gwicke@users.mediawiki.org>
Fri, 20 Feb 2004 18:37:55 +0000 (18:37 +0000)
includes/Skin.php

index ca7bc7e..cdf16ef 100644 (file)
@@ -1528,14 +1528,23 @@ class Skin {
                global $wgUploadDirectory;
                global $wgImageMagickConvertCommand;
                global $wgUseImageMagick;
+               global $wgUseSquid, $wgInternalServer;
                $imgPath   = wfImagePath( $name );
                $thumbName = $width."px-".$icon.$name;
                $thumbPath = wfImageThumbDir( $thumbName )."/".$thumbName;
                $thumbUrl  = wfImageThumbUrl( $thumbName );
 
                if (     (! file_exists( $thumbPath ) && file_exists( $imgPath )) 
-                    ||  ( filemtime($thumbPath) < filemtime($imgPath) ) ) {
-                       if ( $wgUseImageMagick ) {
+               ||  ( filemtime($thumbPath) < filemtime($imgPath) ) ) {
+                       # Squid purging
+                       if ( $wgUseSquid ) {
+                               $urlArr = Array(
+                                       $wgInternalServer.$thumbUrl
+                               );
+                               wfPurgeSquidServers($urlArr);
+                       }
+
+                       if ( $wgUseImageMagick ) {
                                # use ImageMagick
                                $cmd  =  $wgImageMagickConvertCommand .
                                        " -quality 85 -geometry {$width} ".