X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=maintenance%2Fstorage%2FcompressOld.php;h=b27b111e18c8ab83a700614493aade1ee5b69296;hb=23299ca8790bcf1aebcf54e0932b94338e630474;hp=16c676d2c8e44db8d926fd0db98a2181bc72825e;hpb=638c4528259b71a5bc90439fad7cd8d110a86b06;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/storage/compressOld.php b/maintenance/storage/compressOld.php index 16c676d2c8..b27b111e18 100644 --- a/maintenance/storage/compressOld.php +++ b/maintenance/storage/compressOld.php @@ -151,7 +151,7 @@ class CompressOld extends Maintenance { 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', @@ -192,7 +192,7 @@ class CompressOld extends Maintenance { # 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 ); @@ -237,8 +237,8 @@ class CompressOld extends Maintenance { ) { $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 != '' ) { @@ -359,7 +359,7 @@ class CompressOld extends Maintenance { $chunk = new ConcatenatedGzipHistoryBlob(); $stubs = array(); - $dbw->begin( __METHOD__ ); + $this->beginTransaction( $dbw, __METHOD__ ); $usedChunk = false; $primaryOldid = $revs[$i]->rev_text_id; @@ -463,7 +463,7 @@ class CompressOld extends Maintenance { } # Done, next $this->output( "/" ); - $dbw->commit( __METHOD__ ); + $this->commitTransaction( $dbw, __METHOD__ ); $i += $thisChunkSize; wfWaitForSlaves(); }