r111026 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111025‎ | r111026 | r111027 >
Date:10:56, 9 February 2012
Author:hashar
Status:ok
Tags:
Comment:
debug statements for HTMLFileCache / Output
Modified paths:
  • /trunk/phase3/includes/OutputHandler.php (modified) (history)
  • /trunk/phase3/includes/cache/HTMLFileCache.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/OutputHandler.php
@@ -76,9 +76,14 @@
7777 * @return string
7878 */
7979 function wfGzipHandler( $s ) {
80 - if( !function_exists( 'gzencode' ) || headers_sent() ) {
 80+ if( !function_exists( 'gzencode' ) ) {
 81+ wfDebug( __FUNCTION__ . "() skipping compression (gzencode unavaible)\n" );
8182 return $s;
8283 }
 84+ if( headers_sent() ) {
 85+ wfDebug( __FUNCTION__ . "() skipping compression (headers already sent)\n" );
 86+ return $s;
 87+ }
8388
8489 $ext = wfRequestExtension();
8590 if( $ext == '.gz' || $ext == '.tgz' ) {
@@ -90,6 +95,7 @@
9196 }
9297
9398 if( wfClientAcceptsGzip() ) {
 99+ wfDebug( __FUNCTION__ . "() is compressing output\n" );
94100 header( 'Content-Encoding: gzip' );
95101 $s = gzencode( $s, 6 );
96102 }
Index: trunk/phase3/includes/cache/HTMLFileCache.php
@@ -105,6 +105,7 @@
106106
107107 wfDebug( __METHOD__ . "()\n");
108108 $filename = $this->cachePath();
 109+
109110 $context->getOutput()->sendCacheControl();
110111 header( "Content-Type: $wgMimeType; charset=UTF-8" );
111112 header( "Content-Language: $wgLanguageCode" );
@@ -113,6 +114,7 @@
114115 header( 'Content-Encoding: gzip' );
115116 } else {
116117 /* Send uncompressed */
 118+ wfDebug( __METHOD__ . " uncompressing cache file and sending it\n" );
117119 readgzfile( $filename );
118120 return;
119121 }

Status & tagging log