MediaWiki  master
LockManagerGroupFactory.php
Go to the documentation of this file.
1 <?php
2 
4 
7 
13  private $defaultDomain;
14 
17 
19  private $lbFactory;
20 
22  private $instances = [];
23 
32  $this->defaultDomain = $defaultDomain;
33  $this->lockManagerConfigs = $lockManagerConfigs;
34  $this->lbFactory = $lbFactory;
35  }
36 
42  public function getLockManagerGroup( $domain = false ) : LockManagerGroup {
43  if ( $domain === false || $domain === null ) {
44  $domain = $this->defaultDomain;
45  }
46 
47  if ( !isset( $this->instances[$domain] ) ) {
48  $this->instances[$domain] =
49  new LockManagerGroup( $domain, $this->lockManagerConfigs, $this->lbFactory );
50  }
51 
52  return $this->instances[$domain];
53  }
54 }
MediaWiki\FileBackend\LockManager\LockManagerGroupFactory
Service to construct LockManagerGroups.
Definition: LockManagerGroupFactory.php:11
MediaWiki\FileBackend\LockManager\LockManagerGroupFactory\$lockManagerConfigs
array $lockManagerConfigs
Definition: LockManagerGroupFactory.php:16
MediaWiki\FileBackend\LockManager\LockManagerGroupFactory\$instances
LockManagerGroup[] $instances
(domain => LockManagerGroup)
Definition: LockManagerGroupFactory.php:22
LockManagerGroup
Class to handle file lock manager registration.
Definition: LockManagerGroup.php:33
MediaWiki\FileBackend\LockManager\LockManagerGroupFactory\getLockManagerGroup
getLockManagerGroup( $domain=false)
Definition: LockManagerGroupFactory.php:42
MediaWiki\FileBackend\LockManager
Definition: LockManagerGroupFactory.php:3
Wikimedia\Rdbms\LBFactory
An interface for generating database load balancers.
Definition: LBFactory.php:41
MediaWiki\FileBackend\LockManager\LockManagerGroupFactory\__construct
__construct( $defaultDomain, array $lockManagerConfigs, LBFactory $lbFactory)
Do not call directly, use MediaWikiServices.
Definition: LockManagerGroupFactory.php:31
MediaWiki\FileBackend\LockManager\LockManagerGroupFactory\$defaultDomain
string $defaultDomain
Definition: LockManagerGroupFactory.php:13
MediaWiki\FileBackend\LockManager\LockManagerGroupFactory\$lbFactory
LBFactory $lbFactory
Definition: LockManagerGroupFactory.php:19