From 72e90545454c0e014318fa3c81658e035aac58c1 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 10 Jun 2009 13:00:47 +0200 Subject: applying patch to version 1.15.0 --- maintenance/rebuildFileCache.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'maintenance/rebuildFileCache.php') diff --git a/maintenance/rebuildFileCache.php b/maintenance/rebuildFileCache.php index 125b8842..8c01b90f 100644 --- a/maintenance/rebuildFileCache.php +++ b/maintenance/rebuildFileCache.php @@ -17,6 +17,7 @@ $wgDisableCounters = false; // no real hits here $start = isset($args[0]) ? intval($args[0]) : 0; $overwrite = isset( $args[1] ) && $args[1] === 'overwrite'; echo "Building content page file cache from page {$start}!\n"; +echo "Format: [overwrite]\n"; $dbr = wfGetDB( DB_SLAVE ); $start = $start > 0 ? $start : $dbr->selectField( 'page', 'MIN(page_id)', false, __FUNCTION__ ); @@ -34,6 +35,7 @@ $end += $BATCH_SIZE - 1; $blockStart = $start; $blockEnd = $start + $BATCH_SIZE - 1; +$dbw = wfGetDB( DB_MASTER ); // Go through each page and save the output while( $blockEnd <= $end ) { // Get the pages @@ -60,8 +62,6 @@ while( $blockEnd <= $end ) { 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 @@ -77,6 +77,7 @@ while( $blockEnd <= $end ) { } else { echo "Page {$row->page_id} not cacheable\n"; } + $dbw->commit(); // commit any changes } $blockStart += $BATCH_SIZE; $blockEnd += $BATCH_SIZE; -- cgit v1.2.3-54-g00ecf