private function compressOldPages( $start = 0, $extdb = '' ) {
$chunksize = 50;
$this->output( "Starting from old_id $start...\n" );
- $dbw = wfGetDB( DB_MASTER );
+ $dbw = $this->getDB( DB_MASTER );
do {
$res = $dbw->select(
'text',
if ( false !== strpos( $row->old_flags, 'gzip' )
|| false !== strpos( $row->old_flags, 'object' )
) {
- #print "Already compressed row {$row->old_id}\n";
+ # print "Already compressed row {$row->old_id}\n";
return false;
}
- $dbw = wfGetDB( DB_MASTER );
+ $dbw = $this->getDB( DB_MASTER );
$flags = $row->old_flags ? "{$row->old_flags},gzip" : "gzip";
$compress = gzdeflate( $row->old_text );
) {
$loadStyle = self::LS_CHUNKED;
- $dbr = wfGetDB( DB_SLAVE );
- $dbw = wfGetDB( DB_MASTER );
+ $dbr = $this->getDB( DB_SLAVE );
+ $dbw = $this->getDB( DB_MASTER );
# Set up external storage
if ( $extdb != '' ) {
# Don't work with current revisions
# Don't lock the page table for update either -- TS 2006-04-04
- #$tables[] = 'page';
- #$conds[] = 'page_id=rev_page AND rev_id != page_latest';
+ # $tables[] = 'page';
+ # $conds[] = 'page_id=rev_page AND rev_id != page_latest';
for ( $pageId = $startId; $pageId <= $maxPageId; $pageId++ ) {
wfWaitForSlaves();
$chunk = new ConcatenatedGzipHistoryBlob();
$stubs = array();
- $dbw->begin( __METHOD__ );
+ $this->beginTransaction( $dbw, __METHOD__ );
$usedChunk = false;
$primaryOldid = $revs[$i]->rev_text_id;
if ( $text === false ) {
$this->error( "\nError, unable to get text in old_id $oldid" );
- #$dbw->delete( 'old', array( 'old_id' => $oldid ) );
+ # $dbw->delete( 'old', array( 'old_id' => $oldid ) );
}
if ( $extdb == "" && $j == 0 ) {
}
# Done, next
$this->output( "/" );
- $dbw->commit( __METHOD__ );
+ $this->commitTransaction( $dbw, __METHOD__ );
$i += $thisChunkSize;
wfWaitForSlaves();
}