From 2e846682efbf83ee17ab5c457950688e42beb101 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 11 Dec 2008 18:38:06 +0000 Subject: [PATCH] Some more verbose output and fix infinite loop if you make the block size small :) --- maintenance/rebuildFileCache.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/maintenance/rebuildFileCache.php b/maintenance/rebuildFileCache.php index 7d405a0ad4..45d8b4a4d4 100644 --- a/maintenance/rebuildFileCache.php +++ b/maintenance/rebuildFileCache.php @@ -8,7 +8,10 @@ /** */ require_once( "commandLine.inc" ); -if( !$wgUseFileCache ) exit(0); +if( !$wgUseFileCache ) { + echo "Nothing to do -- \$wgUseFileCache is disabled.\n"; + exit(0); +} $start = isset($args[0]) ? intval($args[0]) : 0; echo "Building content page file cache from page {$start}!\n"; @@ -39,7 +42,10 @@ while( $blockEnd <= $end ) { ); while( $row = $dbr->fetchObject( $res ) ) { $wgTitle = Title::makeTitleSafe( $row->page_namespace, $row->page_title ); - if( null == $wgTitle ) continue; // broken title? + if( null == $wgTitle ) { + echo "Page {$row->page_id} bad title\n"; + continue; // broken title? + } $wgArticle = new Article( $wgTitle ); // If the article is cacheable, then load it if( $wgArticle->isFileCacheable() ) { @@ -47,6 +53,8 @@ while( $blockEnd <= $end ) { if( $cache->isFileCacheGood() ) { echo "Page {$row->page_id} already cached\n"; continue; // done already! + } else { + echo "Page {$row->page_id} not cached\n"; } ob_start( array(&$cache, 'saveToFileCache' ) ); // save on ob_end_clean() $wgUseFileCache = false; // hack, we don't want $wgArticle fiddling with filecache @@ -56,10 +64,12 @@ while( $blockEnd <= $end ) { ob_end_clean(); // clear buffer $wgOut = new OutputPage(); // empty out any output page garbage echo "Cached page {$row->page_id}\n"; + } else { + echo "Page {$row->page_id} not cacheable\n"; } } - $blockStart += $BATCH_SIZE - 1; - $blockEnd += $BATCH_SIZE - 1; + $blockStart += $BATCH_SIZE; + $blockEnd += $BATCH_SIZE; wfWaitForSlaves( 5 ); } echo "Done!\n"; -- 2.20.1