Avoid PHP Notices in Translate from messages.inc
[lhc/web/wiklou.git] / maintenance / rebuildFileCache.php
index 441310d..ea07f19 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)
 
@@ -87,7 +93,7 @@ class RebuildFileCache extends Maintenance {
                                array( 'ORDER BY' => 'page_id ASC', 'USE INDEX' => 'PRIMARY' )
                        );
 
-                       $dbw->begin(); // for any changes
+                       $dbw->begin( __METHOD__ ); // for any changes
                        foreach ( $res as $row ) {
                                $rebuilt = false;
                                $wgRequestTime = microtime( true ); # bug 22852
@@ -133,7 +139,7 @@ class RebuildFileCache extends Maintenance {
                                        $this->output( "Page {$row->page_id} not cacheable\n" );
                                }
                        }
-                       $dbw->commit(); // commit any changes (just for sanity)
+                       $dbw->commit( __METHOD__ ); // commit any changes (just for sanity)
 
                        $blockStart += $this->mBatchSize;
                        $blockEnd += $this->mBatchSize;