MediaWiki  master
LockManagerGroup Class Reference

Class to handle file lock manager registration. More...

Collaboration diagram for LockManagerGroup:

Public Member Functions

 __construct ( $domain, array $lockManagerConfigs, LBFactory $lbFactory)
 Do not call this directly. More...
 
 config ( $name)
 Get the config array for a lock manager object with a given name. More...
 
 get ( $name)
 Get the lock manager object with a given name. More...
 
 getAny ()
 Get the default lock manager configured for the site or at least some other effective configured lock manager. More...
 
 getDefault ()
 Get the default lock manager configured for the site. More...
 

Static Public Member Functions

static destroySingletons ()
 Destroy the singleton instances. More...
 
static singleton ( $domain=false)
 

Protected Attributes

string $domain
 domain (usually wiki ID) More...
 
LBFactory $lbFactory
 
array $managers = []
 Array of (name => ('class' => ..., 'config' => ..., 'instance' => ...)) More...
 

Detailed Description

Class to handle file lock manager registration.

Since
1.19

Definition at line 33 of file LockManagerGroup.php.

Constructor & Destructor Documentation

◆ __construct()

LockManagerGroup::__construct (   $domain,
array  $lockManagerConfigs,
LBFactory  $lbFactory 
)

Do not call this directly.

Use LockManagerGroupFactory.

Parameters
string$domainDomain (usually wiki ID)
array[]$lockManagerConfigs In format of $wgLockManagers
LBFactory$lbFactory

Definition at line 50 of file LockManagerGroup.php.

References $domain, and $lbFactory.

Member Function Documentation

◆ config()

LockManagerGroup::config (   $name)

Get the config array for a lock manager object with a given name.

Parameters
string$name
Returns
array
Exceptions
Exception

Definition at line 124 of file LockManagerGroup.php.

◆ destroySingletons()

static LockManagerGroup::destroySingletons ( )
static

Destroy the singleton instances.

Deprecated:
since 1.34, use resetServiceForTesting() on LockManagerGroupFactory

Definition at line 89 of file LockManagerGroup.php.

◆ get()

LockManagerGroup::get (   $name)

Get the lock manager object with a given name.

Parameters
string$name
Returns
LockManager
Exceptions
Exception

Definition at line 100 of file LockManagerGroup.php.

◆ getAny()

LockManagerGroup::getAny ( )

Get the default lock manager configured for the site or at least some other effective configured lock manager.

Throws an exception if no lock manager could be found.

XXX This looks unused, should we just get rid of it?

Returns
LockManager
Exceptions
Exception

Definition at line 157 of file LockManagerGroup.php.

◆ getDefault()

LockManagerGroup::getDefault ( )

Get the default lock manager configured for the site.

Returns NullLockManager if no lock manager could be found.

XXX This looks unused, should we just get rid of it?

Returns
LockManager

Definition at line 141 of file LockManagerGroup.php.

◆ singleton()

static LockManagerGroup::singleton (   $domain = false)
static
Deprecated:
since 1.34, use LockManagerGroupFactory
Parameters
bool | string$domainDomain (usually wiki ID). Default: false.
Returns
LockManagerGroup

Definition at line 79 of file LockManagerGroup.php.

Referenced by FileBackendGroup\config().

Member Data Documentation

◆ $domain

string LockManagerGroup::$domain
protected

domain (usually wiki ID)

Definition at line 35 of file LockManagerGroup.php.

Referenced by __construct().

◆ $lbFactory

LBFactory LockManagerGroup::$lbFactory
protected

Definition at line 38 of file LockManagerGroup.php.

Referenced by __construct().

◆ $managers

array LockManagerGroup::$managers = []
protected

Array of (name => ('class' => ..., 'config' => ..., 'instance' => ...))

Definition at line 41 of file LockManagerGroup.php.


The documentation for this class was generated from the following file: