r110761 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110760‎ | r110761 | r110762 >
Date:17:17, 6 February 2012
Author:hashar
Status:resolved (Comments)
Tags:
Comment:
disable wgDebugToolbar when rebuilding file cache

credits to iAlex :)
Modified paths:
  • /trunk/phase3/includes/cache/HTMLFileCache.php (modified) (history)
  • /trunk/phase3/maintenance/rebuildFileCache.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/rebuildFileCache.php
@@ -34,10 +34,14 @@
3535
3636 public function execute() {
3737 global $wgUseFileCache, $wgReadOnly, $wgContentNamespaces, $wgRequestTime;
 38+ global $wgDebugToolbar;
3839 global $wgTitle, $wgOut;
3940 if ( !$wgUseFileCache ) {
4041 $this->error( "Nothing to do -- \$wgUseFileCache is disabled.", true );
4142 }
 43+ // Debug toolbar makes content uncacheable
 44+ $wgDebugToolbar = false;
 45+
4246 $wgReadOnly = 'Building cache'; // avoid DB writes (like enotif/counters)
4347
4448 $start = $this->getOption( 'start', "0" );
Index: trunk/phase3/includes/cache/HTMLFileCache.php
@@ -61,10 +61,15 @@
6262 * @return bool
6363 */
6464 public static function useFileCache( IContextSource $context ) {
65 - global $wgUseFileCache, $wgShowIPinHeader, $wgContLang;
 65+ global $wgUseFileCache, $wgShowIPinHeader, $wgDebugToolbar, $wgContLang;
6666 if ( !$wgUseFileCache ) {
6767 return false;
6868 }
 69+ if( $wgShowIPinHeader || $wgDebugToolbar ) {
 70+ wfDebug("HTML file cache skipped. Either \$wgShowIPinHeader and/or \$wgDebugToolbar on\n" );
 71+ return false;
 72+ }
 73+
6974 // Get all query values
7075 $queryVals = $context->getRequest()->getValues();
7176 foreach ( $queryVals as $query => $val ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r110762Recommit r110758 (again) now that the problem has been fixed in r110761ialex17:34, 6 February 2012
r110793Follow-up r110761: removed duplicate check of $wgShowIPinHeader and fix some ...ialex21:52, 6 February 2012
r110829rebuildFileCache now really disable debugToolbar...hashar09:37, 7 February 2012

Comments

#Comment by Hashar (talk | contribs)   09:38, 7 February 2012

Setting $wgDebugToolbar = false; was not disabling anything. Fixed with r110829.

Status & tagging log