X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=maintenance%2Fstorage%2FcheckStorage.php;h=060f32768dc45691df0431169c15bb944fd7d2d8;hb=75e2607211b30103417d73a780498b9d27537b62;hp=173d741be86f48900efff7478a4058cd67f50c15;hpb=c3e549a732b8ed47973a28aa350d3c5b6b96928c;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/storage/checkStorage.php b/maintenance/storage/checkStorage.php index 173d741be8..060f32768d 100644 --- a/maintenance/storage/checkStorage.php +++ b/maintenance/storage/checkStorage.php @@ -22,6 +22,7 @@ */ use MediaWiki\MediaWikiServices; +use MediaWiki\Revision\RevisionRecord; use MediaWiki\Shell\Shell; if ( !defined( 'MEDIAWIKI' ) ) { @@ -45,6 +46,7 @@ if ( !defined( 'MEDIAWIKI' ) ) { class CheckStorage { const CONCAT_HEADER = 'O:27:"concatenatedgziphistoryblob"'; public $oldIdMap, $errors; + /** @var ExternalStoreDB */ public $dbStore = null; public $errorDescriptions = [ @@ -104,7 +106,9 @@ class CheckStorage { [], [ 'content' => [ 'INNER JOIN', [ 'content_id = slot_content_id' ] ] ] ); + /** @var \MediaWiki\Storage\SqlBlobStore $blobStore */ $blobStore = MediaWikiServices::getInstance()->getBlobStore(); + '@phan-var \MediaWiki\Storage\SqlBlobStore $blobStore'; foreach ( $res as $row ) { $textId = $blobStore->getTextIdFromAddress( $row->content_address ); if ( $textId ) { @@ -223,7 +227,8 @@ class CheckStorage { // Check external normal blobs for existence if ( count( $externalNormalBlobs ) ) { if ( is_null( $this->dbStore ) ) { - $this->dbStore = new ExternalStoreDB; + $esFactory = MediaWikiServices::getInstance()->getExternalStoreFactory(); + $this->dbStore = $esFactory->getStore( 'DB' ); } foreach ( $externalConcatBlobs as $cluster => $xBlobIds ) { $blobIds = array_keys( $xBlobIds ); @@ -422,7 +427,8 @@ class CheckStorage { } if ( is_null( $this->dbStore ) ) { - $this->dbStore = new ExternalStoreDB; + $esFactory = MediaWikiServices::getInstance()->getExternalStoreFactory(); + $this->dbStore = $esFactory->getStore( 'DB' ); } foreach ( $externalConcatBlobs as $cluster => $oldIds ) { @@ -520,7 +526,7 @@ class CheckStorage { function importRevision( &$revision, &$importer ) { $id = $revision->getID(); - $content = $revision->getContent( Revision::RAW ); + $content = $revision->getContent( RevisionRecord::RAW ); $id = $id ?: ''; if ( $content === null ) {