MediaWiki REL1_39
RevisionStoreFactory.php
Go to the documentation of this file.
1<?php
2
27namespace MediaWiki\Revision;
28
30use BagOStuff;
31use CommentStore;
38use Psr\Log\LoggerInterface;
39use TitleFactory;
41use Wikimedia\Assert\Assert;
43
57
59 private $blobStoreFactory;
61 private $dbLoadBalancerFactory;
63 private $cache;
65 private $localCache;
67 private $logger;
68
70 private $commentStore;
72 private $actorMigration;
74 private $actorStoreFactory;
76 private $nameTables;
77
79 private $slotRoleRegistry;
80
82 private $contentHandlerFactory;
83
85 private $pageStoreFactory;
86
88 private $titleFactory;
89
91 private $hookContainer;
92
109 public function __construct(
110 ILBFactory $dbLoadBalancerFactory,
111 BlobStoreFactory $blobStoreFactory,
112 NameTableStoreFactory $nameTables,
113 SlotRoleRegistry $slotRoleRegistry,
114 WANObjectCache $cache,
115 BagOStuff $localCache,
116 CommentStore $commentStore,
117 ActorMigration $actorMigration,
118 ActorStoreFactory $actorStoreFactory,
119 LoggerInterface $logger,
120 IContentHandlerFactory $contentHandlerFactory,
121 PageStoreFactory $pageStoreFactory,
122 TitleFactory $titleFactory,
123 HookContainer $hookContainer
124 ) {
125 $this->dbLoadBalancerFactory = $dbLoadBalancerFactory;
126 $this->blobStoreFactory = $blobStoreFactory;
127 $this->slotRoleRegistry = $slotRoleRegistry;
128 $this->nameTables = $nameTables;
129 $this->cache = $cache;
130 $this->localCache = $localCache;
131 $this->commentStore = $commentStore;
132 $this->actorMigration = $actorMigration;
133 $this->actorStoreFactory = $actorStoreFactory;
134 $this->logger = $logger;
135 $this->contentHandlerFactory = $contentHandlerFactory;
136 $this->pageStoreFactory = $pageStoreFactory;
137 $this->titleFactory = $titleFactory;
138 $this->hookContainer = $hookContainer;
139 }
140
148 public function getRevisionStore( $dbDomain = false ) {
149 Assert::parameterType( [ 'string', 'false' ], $dbDomain, '$dbDomain' );
150
151 $store = new RevisionStore(
152 $this->dbLoadBalancerFactory->getMainLB( $dbDomain ),
153 $this->blobStoreFactory->newSqlBlobStore( $dbDomain ),
154 $this->cache, // Pass cache local to wiki; Leave cache sharing to RevisionStore.
155 $this->localCache,
156 $this->commentStore,
157 $this->nameTables->getContentModels( $dbDomain ),
158 $this->nameTables->getSlotRoles( $dbDomain ),
159 $this->slotRoleRegistry,
160 $this->actorMigration,
161 $this->actorStoreFactory->getActorStore( $dbDomain ),
162 $this->contentHandlerFactory,
163 $this->pageStoreFactory->getPageStore( $dbDomain ),
164 $this->titleFactory,
165 $this->hookContainer,
166 $dbDomain
167 );
168
169 $store->setLogger( $this->logger );
170
171 return $store;
172 }
173}
This is not intended to be a long-term part of MediaWiki; it will be deprecated and removed once acto...
Class representing a cache/ephemeral data store.
Definition BagOStuff.php:85
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, BagOStuff $localCache, 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.
Manager of ILoadBalancer objects, and indirectly of IDatabase connections.
$cache
Definition mcc.php:33