MediaWiki  master
RevisionStoreFactory.php
Go to the documentation of this file.
1 <?php
2 
26 namespace MediaWiki\Revision;
27 
28 use ActorMigration;
29 use CommentStore;
34 use Psr\Log\LoggerInterface;
35 use WANObjectCache;
36 use Wikimedia\Assert\Assert;
38 
52 
58  private $cache;
60  private $logger;
61 
63  private $commentStore;
65  private $actorMigration;
66 
68  private $nameTables;
69 
72 
75 
77  private $hookContainer;
78 
91  public function __construct(
92  ILBFactory $dbLoadBalancerFactory,
93  BlobStoreFactory $blobStoreFactory,
94  NameTableStoreFactory $nameTables,
99  LoggerInterface $logger,
100  IContentHandlerFactory $contentHandlerFactory,
101  HookContainer $hookContainer
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 }
Revision\RevisionStoreFactory\$cache
WANObjectCache $cache
Definition: RevisionStoreFactory.php:58
Revision\RevisionStore
Service for looking up page revisions.
Definition: RevisionStore.php:81
CommentStore
Handle database storage of comments such as edit summaries and log reasons.
Definition: CommentStore.php:42
Revision\RevisionStoreFactory\getRevisionStore
getRevisionStore( $dbDomain=false)
Definition: RevisionStoreFactory.php:122
Revision\RevisionStoreFactory\$hookContainer
HookContainer $hookContainer
Definition: RevisionStoreFactory.php:77
ActorMigration
This class handles the logic for the actor table migration and should always be used in lieu of direc...
Definition: ActorMigration.php:39
MediaWiki\Revision
Definition: ContributionsLookup.php:3
Revision\RevisionStoreFactory\$contentHandlerFactory
IContentHandlerFactory $contentHandlerFactory
Definition: RevisionStoreFactory.php:74
Revision\RevisionStoreFactory\$blobStoreFactory
BlobStoreFactory $blobStoreFactory
Definition: RevisionStoreFactory.php:54
MediaWiki\Storage\BlobStoreFactory
Service for instantiating BlobStores.
Definition: BlobStoreFactory.php:35
Revision\RevisionStoreFactory\$slotRoleRegistry
SlotRoleRegistry $slotRoleRegistry
Definition: RevisionStoreFactory.php:71
Revision\RevisionStoreFactory\$actorMigration
ActorMigration $actorMigration
Definition: RevisionStoreFactory.php:65
MediaWiki\Content\IContentHandlerFactory
Definition: IContentHandlerFactory.php:10
WANObjectCache
Multi-datacenter aware caching interface.
Definition: WANObjectCache.php:125
Revision\RevisionStoreFactory\$nameTables
NameTableStoreFactory $nameTables
Definition: RevisionStoreFactory.php:68
Revision\RevisionStoreFactory\$dbLoadBalancerFactory
ILBFactory $dbLoadBalancerFactory
Definition: RevisionStoreFactory.php:56
Revision\RevisionStoreFactory
Factory service for RevisionStore instances.
Definition: RevisionStoreFactory.php:51
MediaWiki\Storage\NameTableStoreFactory
Definition: NameTableStoreFactory.php:26
Revision\SlotRoleRegistry
A registry service for SlotRoleHandlers, used to define which slot roles are available on which page.
Definition: SlotRoleRegistry.php:48
MediaWiki\HookContainer\HookContainer
HookContainer class.
Definition: HookContainer.php:44
Revision\RevisionStoreFactory\$logger
LoggerInterface $logger
Definition: RevisionStoreFactory.php:60
Revision\RevisionStoreFactory\__construct
__construct(ILBFactory $dbLoadBalancerFactory, BlobStoreFactory $blobStoreFactory, NameTableStoreFactory $nameTables, SlotRoleRegistry $slotRoleRegistry, WANObjectCache $cache, CommentStore $commentStore, ActorMigration $actorMigration, LoggerInterface $logger, IContentHandlerFactory $contentHandlerFactory, HookContainer $hookContainer)
Definition: RevisionStoreFactory.php:91
Revision\RevisionStoreFactory\$commentStore
CommentStore $commentStore
Definition: RevisionStoreFactory.php:63
Wikimedia\Rdbms\ILBFactory
An interface for generating database load balancers.
Definition: ILBFactory.php:33