r16825 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r16824‎ | r16825 | r16826 >
Date:23:34, 6 October 2006
Author:collinj
Status:old
Tags:
Comment:
* (bug 7508) Added option to compress HTML pages by dumpHTML.php
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/maintenance/dumpHTML.inc (modified) (history)
  • /trunk/phase3/maintenance/dumpHTML.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/dumpHTML.inc
@@ -48,6 +48,9 @@
4949 # Has setupGlobals been called?
5050 var $setupDone = false;
5151
 52+ # Has to compress html pages
 53+ var $compress = false;
 54+
5255 # List of raw pages used in the current article
5356 var $rawPages;
5457
@@ -478,6 +481,11 @@
479482 $fullName = "{$this->dest}/$filename";
480483 $fullDir = dirname( $fullName );
481484
 485+ if ( $this->compress ) {
 486+ $fullName .= ".gz";
 487+ $text = gzencode( $text, 9 );
 488+ }
 489+
482490 wfMkdirParents( $fullDir, 0755 );
483491
484492 wfSuppressWarnings();
@@ -619,6 +627,7 @@
620628 }
621629 }
622630
 631+
623632 $sk =& $wgUser->getSkin();
624633 ob_start();
625634 $sk->outputPage( $wgOut );
@@ -739,6 +748,7 @@
740749 $url = str_replace( '$1', "../$iw/" . wfUrlencode( $this->getHashedFilename( $title ) ),
741750 $wgArticlePath );
742751 }
 752+ $url .= $this->compress ? ".gz" : "";
743753 return false;
744754 } else {
745755 return true;
@@ -773,7 +783,7 @@
774784 if ( $url === false ) {
775785 $url = str_replace( '$1', wfUrlencode( $this->getHashedFilename( $title ) ), $wgArticlePath );
776786 }
777 -
 787+ $url .= $this->compress ? ".gz" : "";
778788 return false;
779789 }
780790
Index: trunk/phase3/maintenance/dumpHTML.php
@@ -23,6 +23,7 @@
2424 * --force-copy copy commons instead of symlink, needed for Wikimedia
2525 * --interlang allow interlanguage links
2626 * --image-snapshot copy all images used to the destination directory
 27+ * --compress generate compressed version of the html pages
2728 */
2829
2930
@@ -91,6 +92,7 @@
9293 'sliceNumerator' => $sliceNumerator,
9394 'sliceDenominator' => $sliceDenominator,
9495 'noOverwrite' => $options['no-overwrite'],
 96+ 'compress' => $options['compress'],
9597 ));
9698
9799
Index: trunk/phase3/RELEASE-NOTES
@@ -269,6 +269,7 @@
270270 * Use ImageMagick -thumbnail option instead of -resize to avoid including
271271 excessive metadata in thumbs (requires ImageMagick 6.0.0 or newer).
272272 * (bug 7499) Corrections to Swedish talk namespace names
 273+* (bug 7508) Added option to compress HTML pages by dumpHTML.php
273274
274275
275276 == Languages updated ==

Follow-up revisions

RevisionCommit summaryAuthorDate
r16826Sync of Serbian Variants branch to r16825 of trunk.rainman02:44, 7 October 2006