X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=maintenance%2Fstorage%2FcompressOld.php;h=c4779b948a09934b79072edf214117c80a68c886;hp=beb1975fad6bb76ee081a159cd17015ed16b141a;hb=46072ba301ea98f6e19487ce84c6fd8cc0d403f1;hpb=22ac82f4cd7960735339d23865fce21665ea9c17 diff --git a/maintenance/storage/compressOld.php b/maintenance/storage/compressOld.php index beb1975fad..c4779b948a 100644 --- a/maintenance/storage/compressOld.php +++ b/maintenance/storage/compressOld.php @@ -223,6 +223,7 @@ class CompressOld extends Maintenance { * @param string $extdb * @param bool|int $maxPageId * @return bool + * @suppress PhanTypeInvalidDimOffset */ private function compressWithConcat( $startId, $maxChunkSize, $beginDate, $endDate, $extdb = "", $maxPageId = false @@ -238,6 +239,10 @@ class CompressOld extends Maintenance { /** @var ExternalStoreDB $storeObj */ $storeObj = $esFactory->getStore( 'DB' ); } + // @phan-suppress-next-line PhanAccessMethodInternal + $blobStore = MediaWikiServices::getInstance() + ->getBlobStoreFactory() + ->newSqlBlobStore(); # Get all articles by page_id if ( !$maxPageId ) { @@ -369,8 +374,12 @@ class CompressOld extends Maintenance { for ( $j = 0; $j < $thisChunkSize && $chunk->isHappy(); $j++ ) { $oldid = $revs[$i + $j]->old_id; - # Get text - $text = Revision::getRevisionText( $revs[$i + $j] ); + # Get text. We do not need the full `extractBlob` since the query is built + # to fetch non-externalstore blobs. + $text = $blobStore->decompressData( + $revs[$i + $j]->old_text, + explode( ',', $revs[$i + $j]->old_flags ) + ); if ( $text === false ) { $this->error( "\nError, unable to get text in old_id $oldid" );