MediaWiki REL1_35
RevisionStoreFactory.php
Go to the documentation of this file.
1<?php
2
26namespace MediaWiki\Revision;
27
29use CommentStore;
34use Psr\Log\LoggerInterface;
36use Wikimedia\Assert\Assert;
38
52
58 private $cache;
60 private $logger;
61
66
68 private $nameTables;
69
72
75
78
91 public function __construct(
99 LoggerInterface $logger,
102 ) {
103 $this->dbLoadBalancerFactory = $dbLoadBalancerFactory;
104 $this->blobStoreFactory = $blobStoreFactory;
105 $this->slotRoleRegistry = $slotRoleRegistry;
106 $this->nameTables = $nameTables;
107 $this->cache = $cache;
108 $this->commentStore = $commentStore;
109 $this->actorMigration = $actorMigration;
110 $this->logger = $logger;
111 $this->contentHandlerFactory = $contentHandlerFactory;
112 $this->hookContainer = $hookContainer;
113 }
114
122 public function getRevisionStore( $dbDomain = false ) {
123 Assert::parameterType( 'string|boolean', $dbDomain, '$dbDomain' );
124
125 $store = new RevisionStore(
126 $this->dbLoadBalancerFactory->getMainLB( $dbDomain ),
127 $this->blobStoreFactory->newSqlBlobStore( $dbDomain ),
128 $this->cache, // Pass local cache instance; Leave cache sharing to RevisionStore.
129 $this->commentStore,
130 $this->nameTables->getContentModels( $dbDomain ),
131 $this->nameTables->getSlotRoles( $dbDomain ),
132 $this->slotRoleRegistry,
133 $this->actorMigration,
134 $this->contentHandlerFactory,
135 $this->hookContainer,
136 $dbDomain
137 );
138
139 $store->setLogger( $this->logger );
140
141 return $store;
142 }
143}
This class handles the logic for the actor table migration and should always be used in lieu of direc...
CommentStore handles storage of comments (edit summaries, log reasons, etc) in the database.
Factory service for RevisionStore instances.
__construct(ILBFactory $dbLoadBalancerFactory, BlobStoreFactory $blobStoreFactory, NameTableStoreFactory $nameTables, SlotRoleRegistry $slotRoleRegistry, WANObjectCache $cache, CommentStore $commentStore, ActorMigration $actorMigration, LoggerInterface $logger, IContentHandlerFactory $contentHandlerFactory, 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.
Multi-datacenter aware caching interface.
An interface for generating database load balancers.