Index: trunk/phase3/maintenance/dumpHTML.inc |
— | — | @@ -48,6 +48,9 @@ |
49 | 49 | # Has setupGlobals been called? |
50 | 50 | var $setupDone = false; |
51 | 51 | |
| 52 | + # Has to compress html pages |
| 53 | + var $compress = false; |
| 54 | + |
52 | 55 | # List of raw pages used in the current article |
53 | 56 | var $rawPages; |
54 | 57 | |
— | — | @@ -478,6 +481,11 @@ |
479 | 482 | $fullName = "{$this->dest}/$filename"; |
480 | 483 | $fullDir = dirname( $fullName ); |
481 | 484 | |
| 485 | + if ( $this->compress ) { |
| 486 | + $fullName .= ".gz"; |
| 487 | + $text = gzencode( $text, 9 ); |
| 488 | + } |
| 489 | + |
482 | 490 | wfMkdirParents( $fullDir, 0755 ); |
483 | 491 | |
484 | 492 | wfSuppressWarnings(); |
— | — | @@ -619,6 +627,7 @@ |
620 | 628 | } |
621 | 629 | } |
622 | 630 | |
| 631 | + |
623 | 632 | $sk =& $wgUser->getSkin(); |
624 | 633 | ob_start(); |
625 | 634 | $sk->outputPage( $wgOut ); |
— | — | @@ -739,6 +748,7 @@ |
740 | 749 | $url = str_replace( '$1', "../$iw/" . wfUrlencode( $this->getHashedFilename( $title ) ), |
741 | 750 | $wgArticlePath ); |
742 | 751 | } |
| 752 | + $url .= $this->compress ? ".gz" : ""; |
743 | 753 | return false; |
744 | 754 | } else { |
745 | 755 | return true; |
— | — | @@ -773,7 +783,7 @@ |
774 | 784 | if ( $url === false ) { |
775 | 785 | $url = str_replace( '$1', wfUrlencode( $this->getHashedFilename( $title ) ), $wgArticlePath ); |
776 | 786 | } |
777 | | - |
| 787 | + $url .= $this->compress ? ".gz" : ""; |
778 | 788 | return false; |
779 | 789 | } |
780 | 790 | |
Index: trunk/phase3/maintenance/dumpHTML.php |
— | — | @@ -23,6 +23,7 @@ |
24 | 24 | * --force-copy copy commons instead of symlink, needed for Wikimedia |
25 | 25 | * --interlang allow interlanguage links |
26 | 26 | * --image-snapshot copy all images used to the destination directory |
| 27 | + * --compress generate compressed version of the html pages |
27 | 28 | */ |
28 | 29 | |
29 | 30 | |
— | — | @@ -91,6 +92,7 @@ |
92 | 93 | 'sliceNumerator' => $sliceNumerator, |
93 | 94 | 'sliceDenominator' => $sliceDenominator, |
94 | 95 | 'noOverwrite' => $options['no-overwrite'], |
| 96 | + 'compress' => $options['compress'], |
95 | 97 | )); |
96 | 98 | |
97 | 99 | |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -269,6 +269,7 @@ |
270 | 270 | * Use ImageMagick -thumbnail option instead of -resize to avoid including |
271 | 271 | excessive metadata in thumbs (requires ImageMagick 6.0.0 or newer). |
272 | 272 | * (bug 7499) Corrections to Swedish talk namespace names |
| 273 | +* (bug 7508) Added option to compress HTML pages by dumpHTML.php |
273 | 274 | |
274 | 275 | |
275 | 276 | == Languages updated == |