X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FrebuildFileCache.php;h=e07bf03865015cbc52ff152d0dd1389d15fbd001;hb=d828147333a7d55f13a8c37a68d2f902749999a8;hp=924457aec69513865ee772de93685a758eac2095;hpb=e19a52f2f5376b08c303d31bdcfec56da560f2b0;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/rebuildFileCache.php b/maintenance/rebuildFileCache.php index 924457aec6..e07bf03865 100644 --- a/maintenance/rebuildFileCache.php +++ b/maintenance/rebuildFileCache.php @@ -70,7 +70,7 @@ class RebuildFileCache extends Maintenance { $this->output( "Building content page file cache from page {$start}!\n" ); - $dbr = wfGetDB( DB_SLAVE ); + $dbr = $this->getDB( DB_SLAVE ); $overwrite = $this->getOption( 'overwrite', false ); $start = ( $start > 0 ) ? $start @@ -89,7 +89,7 @@ class RebuildFileCache extends Maintenance { $blockStart = $start; $blockEnd = $start + $this->mBatchSize - 1; - $dbw = wfGetDB( DB_MASTER ); + $dbw = $this->getDB( DB_MASTER ); // Go through each page and save the output while ( $blockEnd <= $end ) { // Get the pages @@ -99,7 +99,7 @@ class RebuildFileCache extends Maintenance { array( 'ORDER BY' => 'page_id ASC', 'USE INDEX' => 'PRIMARY' ) ); - $dbw->begin( __METHOD__ ); // for any changes + $this->beginTransaction( $dbw, __METHOD__ ); // for any changes foreach ( $res as $row ) { $rebuilt = false; $wgRequestTime = microtime( true ); # bug 22852 @@ -145,7 +145,7 @@ class RebuildFileCache extends Maintenance { $this->output( "Page {$row->page_id} not cacheable\n" ); } } - $dbw->commit( __METHOD__ ); // commit any changes (just for sanity) + $this->commitTransaction( $dbw, __METHOD__ ); // commit any changes (just for sanity) $blockStart += $this->mBatchSize; $blockEnd += $this->mBatchSize;