dbLoadBalancerFactory = $dbLoadBalancerFactory; $this->blobStoreFactory = $blobStoreFactory; $this->slotRoleRegistry = $slotRoleRegistry; $this->nameTables = $nameTables; $this->cache = $cache; $this->localCache = $localCache; $this->commentStore = $commentStore; $this->actorStoreFactory = $actorStoreFactory; $this->logger = $logger; $this->contentHandlerFactory = $contentHandlerFactory; $this->pageStoreFactory = $pageStoreFactory; $this->titleFactory = $titleFactory; $this->hookContainer = $hookContainer; } /** * @since 1.32 * * @param false|string $dbDomain DB domain of the relevant wiki or false for the current one * * @return RevisionStore for the given wikiId with all necessary services */ public function getRevisionStore( $dbDomain = false ): RevisionStore { return $this->getStore( $dbDomain, $this->actorStoreFactory->getActorStore( $dbDomain ) ); } /** * @since 1.42 * * @param false|string $dbDomain DB domain of the relevant wiki or false for the current one * * @return RevisionStore for the given wikiId with all necessary services */ public function getRevisionStoreForImport( $dbDomain = false ): RevisionStore { return $this->getStore( $dbDomain, $this->actorStoreFactory->getActorStoreForImport( $dbDomain ) ); } /** * @since 1.43 * * @param false|string $dbDomain DB domain of the relevant wiki or false for the current one * * @return RevisionStore for the given wikiId with all necessary services */ public function getRevisionStoreForUndelete( $dbDomain = false ): RevisionStore { return $this->getStore( $dbDomain, $this->actorStoreFactory->getActorStoreForUndelete( $dbDomain ) ); } /** * @param false|string $dbDomain * @param ActorStore $actorStore * * @return RevisionStore */ private function getStore( $dbDomain, ActorStore $actorStore ) { Assert::parameterType( [ 'string', 'false' ], $dbDomain, '$dbDomain' ); $store = new RevisionStore( $this->dbLoadBalancerFactory->getMainLB( $dbDomain ), $this->blobStoreFactory->newSqlBlobStore( $dbDomain ), $this->cache, // Pass cache local to wiki; Leave cache sharing to RevisionStore. $this->localCache, $this->commentStore, $this->nameTables->getContentModels( $dbDomain ), $this->nameTables->getSlotRoles( $dbDomain ), $this->slotRoleRegistry, $actorStore, $this->contentHandlerFactory, $this->pageStoreFactory->getPageStore( $dbDomain ), $this->titleFactory, $this->hookContainer, $dbDomain ); $store->setLogger( $this->logger ); return $store; } }