MediaWiki
1.23.2
|
An interface for generating database load balancers. More...
Public Member Functions | |
__construct ( $conf) | |
Construct a factory based on a configuration array (typically from $wgLBFactoryConf) More... | |
callMethod ( $loadBalancer, $methodName, $args) | |
Private helper for forEachLBCallMethod. More... | |
commitMasterChanges () | |
Commit changes on all master connections. More... | |
forEachLB ( $callback, $params=array()) | |
Execute a function for each tracked load balancer The callback is called with the load balancer as the first parameter, and $params passed as the subsequent parameters. More... | |
forEachLBCallMethod ( $methodName, $args=array()) | |
Call a method of each tracked load balancer. More... | |
& | getExternalLB ( $cluster, $wiki=false) |
Get a cached (tracked) load balancer for external storage. More... | |
getMainLB ( $wiki=false) | |
Get a cached (tracked) load balancer object. More... | |
hasMasterChanges () | |
Detemine if any master connection has pending changes. More... | |
newExternalLB ( $cluster, $wiki=false) | |
Create a new load balancer for external storage. More... | |
newMainLB ( $wiki=false) | |
Create a new load balancer object. More... | |
rollbackMasterChanges () | |
Rollback changes on all master connections. More... | |
shutdown () | |
Prepare all tracked load balancers for shutdown STUB. More... | |
Static Public Member Functions | |
static | destroyInstance () |
Shut down, close connections and destroy the cached instance. More... | |
static | disableBackend () |
Disables all access to the load balancer, will cause all database access to throw a DBAccessError. More... | |
static | getLBFactoryClass (array $config) |
Returns the LBFactory class to use and the load balancer configuration. More... | |
static | setInstance ( $instance) |
Set the instance to be the given object. More... | |
static & | singleton () |
Get an LBFactory instance. More... | |
Static Protected Attributes | |
static | $instance |
An interface for generating database load balancers.
Definition at line 28 of file LBFactory.php.
|
abstract |
Construct a factory based on a configuration array (typically from $wgLBFactoryConf)
array | $conf |
Reimplemented in LBFactoryFake, LBFactorySimple, LBFactoryMulti, and LBFactorySingle.
LBFactory::callMethod | ( | $loadBalancer, | |
$methodName, | |||
$args | |||
) |
Private helper for forEachLBCallMethod.
LoadBalancer | $loadBalancer | |
string | $methodName | |
$args |
Definition at line 184 of file LBFactory.php.
LBFactory::commitMasterChanges | ( | ) |
Commit changes on all master connections.
Definition at line 191 of file LBFactory.php.
References forEachLBCallMethod().
Referenced by LBFactorySimple\shutdown(), and LBFactoryMulti\shutdown().
|
static |
Shut down, close connections and destroy the cached instance.
Definition at line 90 of file LBFactory.php.
Referenced by Maintenance\finalSetup(), and setInstance().
|
static |
Disables all access to the load balancer, will cause all database access to throw a DBAccessError.
Definition at line 36 of file LBFactory.php.
References global.
Referenced by Installer\__construct().
|
abstract |
Execute a function for each tracked load balancer The callback is called with the load balancer as the first parameter, and $params passed as the subsequent parameters.
callable | $callback | |
array | $params |
Reimplemented in LBFactoryFake, LBFactoryMulti, LBFactorySimple, and LBFactorySingle.
Referenced by forEachLBCallMethod(), and hasMasterChanges().
LBFactory::forEachLBCallMethod | ( | $methodName, | |
$args = array() |
|||
) |
Call a method of each tracked load balancer.
string | $methodName | |
array | $args |
Definition at line 174 of file LBFactory.php.
References $args, array(), and forEachLB().
Referenced by commitMasterChanges(), and rollbackMasterChanges().
|
abstract |
Get a cached (tracked) load balancer for external storage.
string | $cluster | external storage cluster, or false for core |
bool | string | $wiki | Wiki ID, or false for the current wiki |
Reimplemented in LBFactoryFake, LBFactorySimple, LBFactoryMulti, and LBFactorySingle.
|
static |
Returns the LBFactory class to use and the load balancer configuration.
array | $config | (e.g. $wgLBFactoryConf) |
Definition at line 64 of file LBFactory.php.
References array(), and wfDeprecated().
Referenced by singleton(), and LBFactoryTest\testGetLBFactoryClass().
|
abstract |
Get a cached (tracked) load balancer object.
bool | string | $wiki | Wiki ID, or false for the current wiki |
Reimplemented in LBFactoryFake, LBFactorySimple, LBFactoryMulti, and LBFactorySingle.
LBFactory::hasMasterChanges | ( | ) |
Detemine if any master connection has pending changes.
Definition at line 208 of file LBFactory.php.
References $lb, $ret, and forEachLB().
|
abstract |
Create a new load balancer for external storage.
The resulting object will be untracked, not chronology-protected, and the caller is responsible for cleaning it up.
string | $cluster | External storage cluster, or false for core |
bool | string | $wiki | Wiki ID, or false for the current wiki |
Reimplemented in LBFactoryFake, LBFactorySimple, LBFactoryMulti, and LBFactorySingle.
|
abstract |
Create a new load balancer object.
The resulting object will be untracked, not chronology-protected, and the caller is responsible for cleaning it up.
bool | string | $wiki | Wiki ID, or false for the current wiki |
Reimplemented in LBFactoryFake, LBFactorySimple, LBFactoryMulti, and LBFactorySingle.
LBFactory::rollbackMasterChanges | ( | ) |
Rollback changes on all master connections.
Definition at line 199 of file LBFactory.php.
References forEachLBCallMethod().
|
static |
Set the instance to be the given object.
LBFactory | $instance |
Definition at line 103 of file LBFactory.php.
References $instance, and destroyInstance().
Referenced by DatabaseInstaller\enableLB().
LBFactory::shutdown | ( | ) |
Prepare all tracked load balancers for shutdown STUB.
Reimplemented in LBFactoryMulti, and LBFactorySimple.
Definition at line 165 of file LBFactory.php.
|
static |
Get an LBFactory instance.
Definition at line 46 of file LBFactory.php.
References $instance, getLBFactoryClass(), and global.
|
staticprotected |
Definition at line 30 of file LBFactory.php.
Referenced by setInstance(), and singleton().