MediaWiki REL1_32
RevisionStoreFactory.php
Go to the documentation of this file.
1<?php
2
26namespace MediaWiki\Revision;
27
29use CommentStore;
30use MediaWiki\Logger\Spi as LoggerSpi;
34use Wikimedia\Assert\Assert;
36
50
56 private $cache;
59
71
73 private $nameTables;
74
87 public function __construct(
94 $migrationStage,
95 LoggerSpi $loggerProvider,
97 ) {
98 Assert::parameterType( 'integer', $migrationStage, '$migrationStage' );
99 $this->dbLoadBalancerFactory = $dbLoadBalancerFactory;
100 $this->blobStoreFactory = $blobStoreFactory;
101 $this->nameTables = $nameTables;
102 $this->cache = $cache;
103 $this->commentStore = $commentStore;
104 $this->actorMigration = $actorMigration;
105 $this->mcrMigrationStage = $migrationStage;
106 $this->loggerProvider = $loggerProvider;
107 $this->contentHandlerUseDB = $contentHandlerUseDB;
108 }
109
117 public function getRevisionStore( $wikiId = false ) {
118 Assert::parameterType( 'string|boolean', $wikiId, '$wikiId' );
119
120 $store = new RevisionStore(
121 $this->dbLoadBalancerFactory->getMainLB( $wikiId ),
122 $this->blobStoreFactory->newSqlBlobStore( $wikiId ),
123 $this->cache, // Pass local cache instance; Leave cache sharing to RevisionStore.
124 $this->commentStore,
125 $this->nameTables->getContentModels( $wikiId ),
126 $this->nameTables->getSlotRoles( $wikiId ),
127 $this->mcrMigrationStage,
128 $this->actorMigration,
129 $wikiId
130 );
131
132 $store->setLogger( $this->loggerProvider->getLogger( 'RevisionStore' ) );
133 $store->setContentHandlerUseDB( $this->contentHandlerUseDB );
134
135 return $store;
136 }
137}
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, WANObjectCache $cache, CommentStore $commentStore, ActorMigration $actorMigration, $migrationStage, LoggerSpi $loggerProvider, $contentHandlerUseDB)
Service for looking up page revisions.
Service for instantiating BlobStores.
Multi-datacenter aware caching interface.
Service provider interface for \Psr\Log\LoggerInterface implementation libraries.
Definition Spi.php:36
An interface for generating database load balancers.
you have access to all of the normal MediaWiki so you can get a DB use the cache