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;
33 use Psr\Log\LoggerInterface;
34 use WANObjectCache;
35 use Wikimedia\Assert\Assert;
37 
51 
57  private $cache;
59  private $logger;
60 
62  private $commentStore;
64  private $actorMigration;
65 
67  private $nameTables;
68 
71 
74 
86  public function __construct(
87  ILBFactory $dbLoadBalancerFactory,
88  BlobStoreFactory $blobStoreFactory,
89  NameTableStoreFactory $nameTables,
94  LoggerInterface $logger,
95  IContentHandlerFactory $contentHandlerFactory
96  ) {
97  $this->dbLoadBalancerFactory = $dbLoadBalancerFactory;
98  $this->blobStoreFactory = $blobStoreFactory;
99  $this->slotRoleRegistry = $slotRoleRegistry;
100  $this->nameTables = $nameTables;
101  $this->cache = $cache;
102  $this->commentStore = $commentStore;
103  $this->actorMigration = $actorMigration;
104  $this->logger = $logger;
105  $this->contentHandlerFactory = $contentHandlerFactory;
106  }
107 
115  public function getRevisionStore( $dbDomain = false ) {
116  Assert::parameterType( 'string|boolean', $dbDomain, '$dbDomain' );
117 
118  $store = new RevisionStore(
119  $this->dbLoadBalancerFactory->getMainLB( $dbDomain ),
120  $this->blobStoreFactory->newSqlBlobStore( $dbDomain ),
121  $this->cache, // Pass local cache instance; Leave cache sharing to RevisionStore.
122  $this->commentStore,
123  $this->nameTables->getContentModels( $dbDomain ),
124  $this->nameTables->getSlotRoles( $dbDomain ),
125  $this->slotRoleRegistry,
126  $this->actorMigration,
127  $this->contentHandlerFactory,
128  $dbDomain
129  );
130 
131  $store->setLogger( $this->logger );
132 
133  return $store;
134  }
135 }
Revision\RevisionStoreFactory\$cache
WANObjectCache $cache
Definition: RevisionStoreFactory.php:57
Revision\RevisionStore
Service for looking up page revisions.
Definition: RevisionStore.php:78
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:115
ActorMigration
This class handles the logic for the actor table migration.
Definition: ActorMigration.php:38
MediaWiki\Revision
Definition: FallbackSlotRoleHandler.php:23
Revision\RevisionStoreFactory\$contentHandlerFactory
IContentHandlerFactory $contentHandlerFactory
Definition: RevisionStoreFactory.php:73
Revision\RevisionStoreFactory\$blobStoreFactory
BlobStoreFactory $blobStoreFactory
Definition: RevisionStoreFactory.php:53
MediaWiki\Storage\BlobStoreFactory
Service for instantiating BlobStores.
Definition: BlobStoreFactory.php:35
Revision\RevisionStoreFactory\$slotRoleRegistry
SlotRoleRegistry $slotRoleRegistry
Definition: RevisionStoreFactory.php:70
Revision\RevisionStoreFactory\$actorMigration
ActorMigration $actorMigration
Definition: RevisionStoreFactory.php:64
MediaWiki\Content\IContentHandlerFactory
Definition: IContentHandlerFactory.php:10
WANObjectCache
Multi-datacenter aware caching interface.
Definition: WANObjectCache.php:120
Revision\RevisionStoreFactory\$nameTables
NameTableStoreFactory $nameTables
Definition: RevisionStoreFactory.php:67
Revision\RevisionStoreFactory\$dbLoadBalancerFactory
ILBFactory $dbLoadBalancerFactory
Definition: RevisionStoreFactory.php:55
Revision\RevisionStoreFactory
Factory service for RevisionStore instances.
Definition: RevisionStoreFactory.php:50
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:59
Revision\RevisionStoreFactory\$commentStore
CommentStore $commentStore
Definition: RevisionStoreFactory.php:62
Revision\RevisionStoreFactory\__construct
__construct(ILBFactory $dbLoadBalancerFactory, BlobStoreFactory $blobStoreFactory, NameTableStoreFactory $nameTables, SlotRoleRegistry $slotRoleRegistry, WANObjectCache $cache, CommentStore $commentStore, ActorMigration $actorMigration, LoggerInterface $logger, IContentHandlerFactory $contentHandlerFactory)
Definition: RevisionStoreFactory.php:86
Wikimedia\Rdbms\ILBFactory
An interface for generating database load balancers.
Definition: ILBFactory.php:33