MediaWiki REL1_37
RevisionStoreFactory.php
Go to the documentation of this file.
1<?php
2
27namespace MediaWiki\Revision;
28
30use CommentStore;
37use Psr\Log\LoggerInterface;
38use TitleFactory;
40use Wikimedia\Assert\Assert;
42
56
62 private $cache;
64 private $logger;
65
73 private $nameTables;
74
77
80
83
86
89
105 public function __construct(
114 LoggerInterface $logger,
119 ) {
120 $this->dbLoadBalancerFactory = $dbLoadBalancerFactory;
121 $this->blobStoreFactory = $blobStoreFactory;
122 $this->slotRoleRegistry = $slotRoleRegistry;
123 $this->nameTables = $nameTables;
124 $this->cache = $cache;
125 $this->commentStore = $commentStore;
126 $this->actorMigration = $actorMigration;
127 $this->actorStoreFactory = $actorStoreFactory;
128 $this->logger = $logger;
129 $this->contentHandlerFactory = $contentHandlerFactory;
130 $this->pageStoreFactory = $pageStoreFactory;
131 $this->titleFactory = $titleFactory;
132 $this->hookContainer = $hookContainer;
133 }
134
142 public function getRevisionStore( $dbDomain = false ) {
143 Assert::parameterType( 'string|boolean', $dbDomain, '$dbDomain' );
144
145 $store = new RevisionStore(
146 $this->dbLoadBalancerFactory->getMainLB( $dbDomain ),
147 $this->blobStoreFactory->newSqlBlobStore( $dbDomain ),
148 $this->cache, // Pass local cache instance; Leave cache sharing to RevisionStore.
149 $this->commentStore,
150 $this->nameTables->getContentModels( $dbDomain ),
151 $this->nameTables->getSlotRoles( $dbDomain ),
152 $this->slotRoleRegistry,
153 $this->actorMigration,
154 $this->actorStoreFactory->getActorStore( $dbDomain ),
155 $this->contentHandlerFactory,
156 $this->pageStoreFactory->getPageStore( $dbDomain ),
157 $this->titleFactory,
158 $this->hookContainer,
159 $dbDomain
160 );
161
162 $store->setLogger( $this->logger );
163
164 return $store;
165 }
166}
This is not intended to be a long-term part of MediaWiki; it will be deprecated and removed once acto...
Handle database storage of comments such as edit summaries and log reasons.
Factory service for RevisionStore instances.
__construct(ILBFactory $dbLoadBalancerFactory, BlobStoreFactory $blobStoreFactory, NameTableStoreFactory $nameTables, SlotRoleRegistry $slotRoleRegistry, WANObjectCache $cache, CommentStore $commentStore, ActorMigration $actorMigration, ActorStoreFactory $actorStoreFactory, LoggerInterface $logger, IContentHandlerFactory $contentHandlerFactory, PageStoreFactory $pageStoreFactory, TitleFactory $titleFactory, HookContainer $hookContainer)
Service for looking up page revisions.
A registry service for SlotRoleHandlers, used to define which slot roles are available on which page.
Service for instantiating BlobStores.
Creates Title objects.
Multi-datacenter aware caching interface.
An interface for generating database load balancers.