*/
private $contentHandlerUseDB;
+ /** @var NameTableStoreFactory */
+ private $nameTables;
+
/**
* @param ILBFactory $dbLoadBalancerFactory
* @param BlobStoreFactory $blobStoreFactory
+ * @param NameTableStoreFactory $nameTables
* @param WANObjectCache $cache
* @param CommentStore $commentStore
* @param ActorMigration $actorMigration
public function __construct(
ILBFactory $dbLoadBalancerFactory,
BlobStoreFactory $blobStoreFactory,
+ NameTableStoreFactory $nameTables,
WANObjectCache $cache,
CommentStore $commentStore,
ActorMigration $actorMigration,
Assert::parameterType( 'integer', $migrationStage, '$migrationStage' );
$this->dbLoadBalancerFactory = $dbLoadBalancerFactory;
$this->blobStoreFactory = $blobStoreFactory;
+ $this->nameTables = $nameTables;
$this->cache = $cache;
$this->commentStore = $commentStore;
$this->actorMigration = $actorMigration;
$this->loggerProvider = $loggerProvider;
$this->contentHandlerUseDB = $contentHandlerUseDB;
}
- /**
/**
* @since 1.32
$this->blobStoreFactory->newSqlBlobStore( $wikiId ),
$this->cache, // Pass local cache instance; Leave cache sharing to RevisionStore.
$this->commentStore,
- $this->getContentModelStore( $wikiId ),
- $this->getSlotRoleStore( $wikiId ),
+ $this->nameTables->getContentModels( $wikiId ),
+ $this->nameTables->getSlotRoles( $wikiId ),
$this->mcrMigrationStage,
$this->actorMigration,
$wikiId
return $store;
}
-
- /**
- * @param string $wikiId
- * @return NameTableStore
- */
- private function getContentModelStore( $wikiId ) {
- // XXX: a dedicated ContentModelStore subclass would avoid hard-coding
- // knowledge about the schema here.
- return new NameTableStore(
- $this->dbLoadBalancerFactory->getMainLB( $wikiId ),
- $this->cache, // Pass local cache instance; Leave cache sharing to NameTableStore.
- $this->loggerProvider->getLogger( 'NameTableSqlStore' ),
- 'content_models',
- 'model_id',
- 'model_name',
- null,
- $wikiId
- );
- }
-
- /**
- * @param string $wikiId
- * @return NameTableStore
- */
- private function getSlotRoleStore( $wikiId ) {
- // XXX: a dedicated ContentModelStore subclass would avoid hard-coding
- // knowledge about the schema here.
- return new NameTableStore(
- $this->dbLoadBalancerFactory->getMainLB( $wikiId ),
- $this->cache, // Pass local cache instance; Leave cache sharing to NameTableStore.
- $this->loggerProvider->getLogger( 'NameTableSqlStore' ),
- 'slot_roles',
- 'role_id',
- 'role_name',
- 'strtolower',
- $wikiId
- );
- }
-
}