X-Git-Url: https://git.cyclocoop.org/%7B%7B%20url_for%28%27user%27%2C%20userid=session.user.id%29%20%7D%7D?a=blobdiff_plain;f=maintenance%2FmigrateArchiveText.php;h=7bbf3d0905299037a69a47647f710db75f7d8f18;hb=eda773a437933f2126d84a23c71b177820be3e32;hp=2271c393a8671a81a099ea94be0c8d13dfba6b7d;hpb=9bbb26ffbd16edbaccce27461730fa9e172aa048;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/migrateArchiveText.php b/maintenance/migrateArchiveText.php index 2271c393a8..7bbf3d0905 100644 --- a/maintenance/migrateArchiveText.php +++ b/maintenance/migrateArchiveText.php @@ -21,6 +21,8 @@ * @ingroup Maintenance */ +use MediaWiki\MediaWikiServices; + require_once __DIR__ . '/Maintenance.php'; /** @@ -57,6 +59,10 @@ class MigrateArchiveText extends LoggedUpdateMaintenance { protected function doDBUpdates() { $replaceMissing = $this->hasOption( 'replace-missing' ); $defaultExternalStore = $this->getConfig()->get( 'DefaultExternalStore' ); + // @phan-suppress-next-line PhanAccessMethodInternal + $blobStore = MediaWikiServices::getInstance() + ->getBlobStoreFactory() + ->newSqlBlobStore(); $batchSize = $this->getBatchSize(); $dbr = $this->getDB( DB_REPLICA, [ 'vslow' ] ); @@ -90,8 +96,9 @@ class MigrateArchiveText extends LoggedUpdateMaintenance { // Recompress the text (and store in external storage, if // applicable) if it's not already in external storage. - if ( !in_array( 'external', explode( ',', $row->ar_flags ), true ) ) { - $data = Revision::getRevisionText( $row, 'ar_' ); + $arFlags = explode( ',', $row->ar_flags ); + if ( !in_array( 'external', $arFlags, true ) ) { + $data = $blobStore->decompressData( $row->ar_text, $arFlags ); if ( $data !== false ) { $flags = Revision::compressRevisionText( $data );