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;
32 use Psr\Log\LoggerInterface;
33 use WANObjectCache;
34 use Wikimedia\Assert\Assert;
36 
50 
56  private $cache;
58  private $logger;
59 
61  private $commentStore;
63  private $actorMigration;
71 
73  private $nameTables;
74 
77 
91  public function __construct(
92  ILBFactory $dbLoadBalancerFactory,
93  BlobStoreFactory $blobStoreFactory,
94  NameTableStoreFactory $nameTables,
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  $this->blobStoreFactory->newSqlBlobStore( $dbDomain ),
129  $this->cache, // Pass local cache instance; Leave cache sharing to RevisionStore.
131  $this->nameTables->getContentModels( $dbDomain ),
132  $this->nameTables->getSlotRoles( $dbDomain ),
136  $dbDomain
137  );
138 
139  $store->setLogger( $this->logger );
140  $store->setContentHandlerUseDB( $this->contentHandlerUseDB );
141 
142  return $store;
143  }
144 }
Revision\RevisionStoreFactory\$cache
WANObjectCache $cache
Definition: RevisionStoreFactory.php:56
Revision\RevisionStore
Service for looking up page revisions.
Definition: RevisionStore.php:79
CommentStore
CommentStore handles storage of comments (edit summaries, log reasons, etc) in the database.
Definition: CommentStore.php:31
Revision\RevisionStoreFactory\getRevisionStore
getRevisionStore( $dbDomain=false)
Definition: RevisionStoreFactory.php:123
ActorMigration
This class handles the logic for the actor table migration.
Definition: ActorMigration.php:38
Revision\RevisionStoreFactory\$contentHandlerUseDB
bool $contentHandlerUseDB
Definition: RevisionStoreFactory.php:70
MediaWiki\Revision
Created by PhpStorm.
Definition: FallbackSlotRoleHandler.php:23
Revision\RevisionStoreFactory\$mcrMigrationStage
int $mcrMigrationStage
One of the MIGRATION_* constants.
Definition: RevisionStoreFactory.php:65
Revision\RevisionStoreFactory\$blobStoreFactory
BlobStoreFactory $blobStoreFactory
Definition: RevisionStoreFactory.php:52
MediaWiki\Storage\BlobStoreFactory
Service for instantiating BlobStores.
Definition: BlobStoreFactory.php:35
Revision\RevisionStore\setLogger
setLogger(LoggerInterface $logger)
Definition: RevisionStore.php:232
Revision\RevisionStoreFactory\$slotRoleRegistry
SlotRoleRegistry $slotRoleRegistry
Definition: RevisionStoreFactory.php:76
Revision\RevisionStoreFactory\$actorMigration
ActorMigration $actorMigration
Definition: RevisionStoreFactory.php:63
WANObjectCache
Multi-datacenter aware caching interface.
Definition: WANObjectCache.php:116
Revision\RevisionStoreFactory\$nameTables
NameTableStoreFactory $nameTables
Definition: RevisionStoreFactory.php:73
Revision\RevisionStoreFactory\$dbLoadBalancerFactory
ILBFactory $dbLoadBalancerFactory
Definition: RevisionStoreFactory.php:54
Revision\RevisionStoreFactory
Factory service for RevisionStore instances.
Definition: RevisionStoreFactory.php:49
Revision\RevisionStoreFactory\__construct
__construct(ILBFactory $dbLoadBalancerFactory, BlobStoreFactory $blobStoreFactory, NameTableStoreFactory $nameTables, SlotRoleRegistry $slotRoleRegistry, WANObjectCache $cache, CommentStore $commentStore, ActorMigration $actorMigration, $migrationStage, LoggerInterface $logger, $contentHandlerUseDB)
Definition: RevisionStoreFactory.php:91
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
Revision\RevisionStoreFactory\$logger
LoggerInterface $logger
Definition: RevisionStoreFactory.php:58
Revision\RevisionStoreFactory\$commentStore
CommentStore $commentStore
Definition: RevisionStoreFactory.php:61
Wikimedia\Rdbms\ILBFactory
An interface for generating database load balancers.
Definition: ILBFactory.php:33