rebuildFileCache now really disable debugToolbar
authorAntoine Musso <hashar@users.mediawiki.org>
Tue, 7 Feb 2012 09:37:59 +0000 (09:37 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Tue, 7 Feb 2012 09:37:59 +0000 (09:37 +0000)
r110761 did not properly disabled the debug toolbar. It has to be
done before Setup.php (MWDebug uses a private static to track that
global variable).

really fix r110758 / r110762

maintenance/rebuildFileCache.php

index 441310d..e7ce352 100644 (file)
@@ -32,15 +32,21 @@ class RebuildFileCache extends Maintenance {
                $this->setBatchSize( 100 );
        }
 
+       public function finalSetup() {
+               global $wgDebugToolbar;
+
+               // Debug toolbar makes content uncacheable so we disable it.
+               // Has to be done before Setup.php initialize MWDebug
+               $wgDebugToolbar = false;
+               parent::finalSetup();
+       }
+
        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)