MediaWiki
REL1_34
LockManagerGroupFactory.php
Go to the documentation of this file.
1
<?php
2
3
namespace
MediaWiki\FileBackend\LockManager
;
4
5
use
LockManagerGroup
;
6
use
Wikimedia\Rdbms\LBFactory
;
7
11
class
LockManagerGroupFactory
{
13
private
$defaultDomain
;
14
16
private
$lockManagerConfigs
;
17
19
private
$lbFactory
;
20
22
private
$instances
= [];
23
31
public
function
__construct
(
$defaultDomain
, array
$lockManagerConfigs
,
LBFactory
$lbFactory
) {
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
}
LockManagerGroup
Class to handle file lock manager registration.
Definition
LockManagerGroup.php:33
MediaWiki\FileBackend\LockManager\LockManagerGroupFactory
Service to construct LockManagerGroups.
Definition
LockManagerGroupFactory.php:11
MediaWiki\FileBackend\LockManager\LockManagerGroupFactory\$instances
LockManagerGroup[] $instances
(domain => LockManagerGroup)
Definition
LockManagerGroupFactory.php:22
MediaWiki\FileBackend\LockManager\LockManagerGroupFactory\$lbFactory
LBFactory $lbFactory
Definition
LockManagerGroupFactory.php:19
MediaWiki\FileBackend\LockManager\LockManagerGroupFactory\getLockManagerGroup
getLockManagerGroup( $domain=false)
Definition
LockManagerGroupFactory.php:42
MediaWiki\FileBackend\LockManager\LockManagerGroupFactory\$lockManagerConfigs
array $lockManagerConfigs
Definition
LockManagerGroupFactory.php:16
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
Wikimedia\Rdbms\LBFactory
An interface for generating database load balancers.
Definition
LBFactory.php:40
if
if($IP===false)
Definition
initImageData.php:4
MediaWiki\FileBackend\LockManager
Definition
LockManagerGroupFactory.php:3
includes
filebackend
lockmanager
LockManagerGroupFactory.php
Generated on Mon Nov 25 2024 16:05:07 for MediaWiki by
1.10.0