dbLoadBalancerFactory = $dbLoadBalancerFactory; $this->blobStoreFactory = $blobStoreFactory; $this->cache = $cache; $this->commentStore = $commentStore; $this->actorMigration = $actorMigration; $this->mcrMigrationStage = $migrationStage; $this->loggerProvider = $loggerProvider; $this->contentHandlerUseDB = $contentHandlerUseDB; } /** /** * @since 1.32 * * @param bool|string $wikiId false for the current domain / wikid * * @return RevisionStore for the given wikiId with all necessary services and a logger */ public function getRevisionStore( $wikiId = false ) { Assert::parameterType( 'string|boolean', $wikiId, '$wikiId' ); $store = new RevisionStore( $this->dbLoadBalancerFactory->getMainLB( $wikiId ), $this->blobStoreFactory->newSqlBlobStore( $wikiId ), $this->cache, // Pass local cache instance; Leave cache sharing to RevisionStore. $this->commentStore, $this->getContentModelStore( $wikiId ), $this->getSlotRoleStore( $wikiId ), $this->mcrMigrationStage, $this->actorMigration, $wikiId ); $store->setLogger( $this->loggerProvider->getLogger( 'RevisionStore' ) ); $store->setContentHandlerUseDB( $this->contentHandlerUseDB ); 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 ); } }