MediaWiki
REL1_32
RevisionStoreFactory.php
Go to the documentation of this file.
1
<?php
2
26
namespace
MediaWiki\Revision
;
27
28
use
ActorMigration
;
29
use
CommentStore
;
30
use
MediaWiki\Logger\Spi
as LoggerSpi;
31
use
MediaWiki\Storage\BlobStoreFactory
;
32
use
MediaWiki\Storage\NameTableStoreFactory
;
33
use
WANObjectCache
;
34
use Wikimedia\Assert\Assert;
35
use
Wikimedia\Rdbms\ILBFactory
;
36
49
class
RevisionStoreFactory
{
50
52
private
$blobStoreFactory
;
54
private
$dbLoadBalancerFactory
;
56
private
$cache
;
58
private
$loggerProvider
;
59
61
private
$commentStore
;
63
private
$actorMigration
;
65
private
$mcrMigrationStage
;
70
private
$contentHandlerUseDB
;
71
73
private
$nameTables
;
74
87
public
function
__construct
(
88
ILBFactory
$dbLoadBalancerFactory
,
89
BlobStoreFactory
$blobStoreFactory
,
90
NameTableStoreFactory
$nameTables
,
91
WANObjectCache
$cache
,
92
CommentStore
$commentStore
,
93
ActorMigration
$actorMigration
,
94
$migrationStage,
95
LoggerSpi
$loggerProvider
,
96
$contentHandlerUseDB
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
}
ActorMigration
This class handles the logic for the actor table migration.
Definition
ActorMigration.php:35
CommentStore
CommentStore handles storage of comments (edit summaries, log reasons, etc) in the database.
Definition
CommentStore.php:31
MediaWiki\Revision\RevisionStoreFactory
Factory service for RevisionStore instances.
Definition
RevisionStoreFactory.php:49
MediaWiki\Revision\RevisionStoreFactory\$mcrMigrationStage
int $mcrMigrationStage
One of the MIGRATION_* constants.
Definition
RevisionStoreFactory.php:65
MediaWiki\Revision\RevisionStoreFactory\$nameTables
NameTableStoreFactory $nameTables
Definition
RevisionStoreFactory.php:73
MediaWiki\Revision\RevisionStoreFactory\$loggerProvider
LoggerSpi $loggerProvider
Definition
RevisionStoreFactory.php:58
MediaWiki\Revision\RevisionStoreFactory\$dbLoadBalancerFactory
ILBFactory $dbLoadBalancerFactory
Definition
RevisionStoreFactory.php:54
MediaWiki\Revision\RevisionStoreFactory\$blobStoreFactory
BlobStoreFactory $blobStoreFactory
Definition
RevisionStoreFactory.php:52
MediaWiki\Revision\RevisionStoreFactory\$cache
WANObjectCache $cache
Definition
RevisionStoreFactory.php:56
MediaWiki\Revision\RevisionStoreFactory\$commentStore
CommentStore $commentStore
Definition
RevisionStoreFactory.php:61
MediaWiki\Revision\RevisionStoreFactory\__construct
__construct(ILBFactory $dbLoadBalancerFactory, BlobStoreFactory $blobStoreFactory, NameTableStoreFactory $nameTables, WANObjectCache $cache, CommentStore $commentStore, ActorMigration $actorMigration, $migrationStage, LoggerSpi $loggerProvider, $contentHandlerUseDB)
Definition
RevisionStoreFactory.php:87
MediaWiki\Revision\RevisionStoreFactory\$actorMigration
ActorMigration $actorMigration
Definition
RevisionStoreFactory.php:63
MediaWiki\Revision\RevisionStoreFactory\$contentHandlerUseDB
bool $contentHandlerUseDB
Definition
RevisionStoreFactory.php:70
MediaWiki\Revision\RevisionStoreFactory\getRevisionStore
getRevisionStore( $wikiId=false)
Definition
RevisionStoreFactory.php:117
MediaWiki\Revision\RevisionStore
Service for looking up page revisions.
Definition
RevisionStore.php:77
MediaWiki\Storage\BlobStoreFactory
Service for instantiating BlobStores.
Definition
BlobStoreFactory.php:35
MediaWiki\Storage\NameTableStoreFactory
Definition
NameTableStoreFactory.php:26
WANObjectCache
Multi-datacenter aware caching interface.
Definition
WANObjectCache.php:118
MediaWiki\Logger\Spi
Service provider interface for \Psr\Log\LoggerInterface implementation libraries.
Definition
Spi.php:36
Wikimedia\Rdbms\ILBFactory
An interface for generating database load balancers.
Definition
ILBFactory.php:33
cache
you have access to all of the normal MediaWiki so you can get a DB use the cache
Definition
maintenance.txt:55
MediaWiki\Revision
Created by PhpStorm.
Definition
IncompleteRevisionException.php:23
includes
Revision
RevisionStoreFactory.php
Generated on Mon Nov 25 2024 15:57:34 for MediaWiki by
1.10.0