r11945 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r11944‎ | r11945 | r11946 >
Date:09:04, 4 December 2005
Author:vibber
Status:old
Tags:
Comment:
* (bug 4162) Add $wgThumbnailEpoch timestamp to force old thumbs to
be rerendered on demand, sitewide
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/Image.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Image.php
@@ -912,7 +912,7 @@
913913 function renderThumb( $width, $useScript = true ) {
914914 global $wgUseSquid, $wgInternalServer;
915915 global $wgThumbnailScriptPath, $wgSharedThumbnailScriptPath;
916 - global $wgSVGMaxSize, $wgMaxImageArea;
 916+ global $wgSVGMaxSize, $wgMaxImageArea, $wgThumbnailEpoch;
917917
918918 $fname = 'Image::renderThumb';
919919 wfProfileIn( $fname );
@@ -968,7 +968,8 @@
969969 $thumbName = $this->thumbName( $width, $this->fromSharedDirectory );
970970 $thumbPath = wfImageThumbDir( $this->name, $this->fromSharedDirectory ).'/'.$thumbName;
971971
972 - if ( !file_exists( $thumbPath ) ) {
 972+ if ( !file_exists( $thumbPath ) ||
 973+ filemtime( $thumbPath ) < wfTimestamp( TS_UNIX, $wgThumbnailEpoch ) ) {
973974 $oldThumbPath = wfDeprecatedThumbDir( $thumbName, 'thumb', $this->fromSharedDirectory ).
974975 '/'.$thumbName;
975976 $done = false;
Index: trunk/phase3/includes/DefaultSettings.php
@@ -1179,7 +1179,16 @@
11801180 * 12.5 million pixels or 3500x3500
11811181 */
11821182 $wgMaxImageArea = 1.25e7;
 1183+/**
 1184+ * If rendered thumbnail files are older than this timestamp, they
 1185+ * will be rerendered on demand as if the file didn't already exist.
 1186+ * Update if there is some need to force thumbs and SVG rasterizations
 1187+ * to rerender, such as fixes to rendering bugs.
 1188+ */
 1189+$wgThumbnailEpoch = '20030516000000';
11831190
 1191+
 1192+
11841193 /** Set $wgCommandLineMode if it's not set already, to avoid notices */
11851194 if( !isset( $wgCommandLineMode ) ) {
11861195 $wgCommandLineMode = false;
Index: trunk/phase3/RELEASE-NOTES
@@ -289,6 +289,8 @@
290290 * Optional summary parameter to action=rollback, for user javascript
291291 * (bug 153) Adjust thumbnail size calculations to match consistently;
292292 patch by David Benbennick
 293+* (bug 4162) Add $wgThumbnailEpoch timestamp to force old thumbs to
 294+ be rerendered on demand, sitewide
293295
294296
295297 === Caveats ===

Status & tagging log