MediaWiki REL1_34
RevisionStoreFactory.php
Go to the documentation of this file.
1<?php
2
26namespace MediaWiki\Revision;
27
29use CommentStore;
30use Psr\Log\LoggerInterface;
34use Wikimedia\Assert\Assert;
36
50
56 private $cache;
58 private $logger;
59
71
73 private $nameTables;
74
77
91 public function __construct(
99 $migrationStage,
100 LoggerInterface $logger,
102 ) {
103 Assert::parameterType( 'integer', $migrationStage, '$migrationStage' );
104 $this->dbLoadBalancerFactory = $dbLoadBalancerFactory;
105 $this->blobStoreFactory = $blobStoreFactory;
106 $this->slotRoleRegistry = $slotRoleRegistry;
107 $this->nameTables = $nameTables;
108 $this->cache = $cache;
109 $this->commentStore = $commentStore;
110 $this->actorMigration = $actorMigration;
111 $this->mcrMigrationStage = $migrationStage;
112 $this->logger = $logger;
113 $this->contentHandlerUseDB = $contentHandlerUseDB;
114 }
115
123 public function getRevisionStore( $dbDomain = false ) {
124 Assert::parameterType( 'string|boolean', $dbDomain, '$dbDomain' );
125
126 $store = new RevisionStore(
127 $this->dbLoadBalancerFactory->getMainLB( $dbDomain ),
128 // @phan-suppress-next-line PhanAccessMethodInternal
129 $this->blobStoreFactory->newSqlBlobStore( $dbDomain ),
130 $this->cache, // Pass local cache instance; Leave cache sharing to RevisionStore.
131 $this->commentStore,
132 $this->nameTables->getContentModels( $dbDomain ),
133 $this->nameTables->getSlotRoles( $dbDomain ),
134 $this->slotRoleRegistry,
135 $this->mcrMigrationStage,
136 $this->actorMigration,
137 $dbDomain
138 );
139
140 $store->setLogger( $this->logger );
141 $store->setContentHandlerUseDB( $this->contentHandlerUseDB );
142
143 return $store;
144 }
145}
This class handles the logic for the actor table migration.
CommentStore handles storage of comments (edit summaries, log reasons, etc) in the database.
Factory service for RevisionStore instances.
int $mcrMigrationStage
One of the MIGRATION_* constants.
__construct(ILBFactory $dbLoadBalancerFactory, BlobStoreFactory $blobStoreFactory, NameTableStoreFactory $nameTables, SlotRoleRegistry $slotRoleRegistry, WANObjectCache $cache, CommentStore $commentStore, ActorMigration $actorMigration, $migrationStage, LoggerInterface $logger, $contentHandlerUseDB)
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.