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 WANObjectCache;
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  // @phan-suppress-next-line PhanAccessMethodInternal
129  $this->blobStoreFactory->newSqlBlobStore( $dbDomain ),
130  $this->cache, // Pass local cache instance; Leave cache sharing to RevisionStore.
132  $this->nameTables->getContentModels( $dbDomain ),
133  $this->nameTables->getSlotRoles( $dbDomain ),
137  $dbDomain
138  );
139 
140  $store->setLogger( $this->logger );
141  $store->setContentHandlerUseDB( $this->contentHandlerUseDB );
142 
143  return $store;
144  }
145 }
setLogger(LoggerInterface $logger)
A registry service for SlotRoleHandlers, used to define which slot roles are available on which page...
Factory service for RevisionStore instances.
Created by PhpStorm.
Service for looking up page revisions.
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)