MediaWiki  1.30.0
LockManagerGroup Class Reference

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

Collaboration diagram for LockManagerGroup:

Public Member Functions

 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 Member Functions

 __construct ( $domain)
 
 initFromGlobals ()
 Register lock managers from the global variables. More...
 
 register (array $configs)
 Register an array of file lock manager configurations. More...
 

Protected Attributes

 $domain
 
array $managers = []
 Array of (name => ('class' => ..., 'config' => ..., 'instance' => ...)) More...
 

Static Protected Attributes

static LockManagerGroup[] $instances = []
 (domain => LockManagerGroup) More...
 

Detailed Description

Class to handle file lock manager registration.

Since
1.19

Definition at line 32 of file LockManagerGroup.php.

Constructor & Destructor Documentation

◆ __construct()

LockManagerGroup::__construct (   $domain)
protected
Parameters
string$domainDomain (usually wiki ID)

Definition at line 44 of file LockManagerGroup.php.

References $domain.

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 142 of file LockManagerGroup.php.

References $name.

◆ destroySingletons()

static LockManagerGroup::destroySingletons ( )
static

Destroy the singleton instances.

Definition at line 65 of file LockManagerGroup.php.

Referenced by ForkController\prepareEnvironment().

◆ get()

LockManagerGroup::get (   $name)

Get the lock manager object with a given name.

Parameters
string$name
Returns
LockManager
Exceptions
Exception

Definition at line 111 of file LockManagerGroup.php.

References $name, DB_MASTER, and ObjectCache\getLocalServerInstance().

◆ 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.

Returns
LockManager
Exceptions
Exception

Definition at line 171 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.

Returns
LockManager

Definition at line 157 of file LockManagerGroup.php.

◆ initFromGlobals()

LockManagerGroup::initFromGlobals ( )
protected

Register lock managers from the global variables.

Definition at line 72 of file LockManagerGroup.php.

References $wgLockManagers, and global.

◆ register()

LockManagerGroup::register ( array  $configs)
protected

Register an array of file lock manager configurations.

Parameters
array$configs
Exceptions
Exception

Definition at line 84 of file LockManagerGroup.php.

References $domain, $name, and as.

◆ singleton()

static LockManagerGroup::singleton (   $domain = false)
static
Parameters
bool | string$domainDomain (usually wiki ID). Default: false.
Returns
LockManagerGroup

Definition at line 52 of file LockManagerGroup.php.

References $domain, false, and wfWikiID().

Referenced by FileBackendGroup\config(), StoreBatchTest\setUp(), SwiftFileBackendTest\setUp(), and FileBackendTest\setUp().

Member Data Documentation

◆ $domain

LockManagerGroup::$domain
protected

Definition at line 36 of file LockManagerGroup.php.

Referenced by __construct(), register(), and singleton().

◆ $instances

LockManagerGroup [] LockManagerGroup::$instances = []
staticprotected

(domain => LockManagerGroup)

Definition at line 34 of file LockManagerGroup.php.

◆ $managers

array LockManagerGroup::$managers = []
protected

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

Definition at line 39 of file LockManagerGroup.php.


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