From: Antoine Musso Date: Mon, 6 Feb 2012 17:17:51 +0000 (+0000) Subject: disable wgDebugToolbar when rebuilding file cache X-Git-Tag: 1.31.0-rc.0~24913 X-Git-Url: http://git.cyclocoop.org/%22.%28%24lien.?a=commitdiff_plain;h=57e874c374abc246c6ce7e83890409cef4450ac2;p=lhc%2Fweb%2Fwiklou.git disable wgDebugToolbar when rebuilding file cache credits to iAlex :) --- diff --git a/includes/cache/HTMLFileCache.php b/includes/cache/HTMLFileCache.php index 37d0adce01..6b19fdfdf2 100644 --- a/includes/cache/HTMLFileCache.php +++ b/includes/cache/HTMLFileCache.php @@ -61,10 +61,15 @@ class HTMLFileCache extends FileCacheBase { * @return bool */ public static function useFileCache( IContextSource $context ) { - global $wgUseFileCache, $wgShowIPinHeader, $wgContLang; + global $wgUseFileCache, $wgShowIPinHeader, $wgDebugToolbar, $wgContLang; if ( !$wgUseFileCache ) { return false; } + if( $wgShowIPinHeader || $wgDebugToolbar ) { + wfDebug("HTML file cache skipped. Either \$wgShowIPinHeader and/or \$wgDebugToolbar on\n" ); + return false; + } + // Get all query values $queryVals = $context->getRequest()->getValues(); foreach ( $queryVals as $query => $val ) { diff --git a/maintenance/rebuildFileCache.php b/maintenance/rebuildFileCache.php index b725f0318a..441310da2a 100644 --- a/maintenance/rebuildFileCache.php +++ b/maintenance/rebuildFileCache.php @@ -34,10 +34,14 @@ class RebuildFileCache extends Maintenance { public function execute() { global $wgUseFileCache, $wgReadOnly, $wgContentNamespaces, $wgRequestTime; + global $wgDebugToolbar; global $wgTitle, $wgOut; if ( !$wgUseFileCache ) { $this->error( "Nothing to do -- \$wgUseFileCache is disabled.", true ); } + // Debug toolbar makes content uncacheable + $wgDebugToolbar = false; + $wgReadOnly = 'Building cache'; // avoid DB writes (like enotif/counters) $start = $this->getOption( 'start', "0" );