MediaWiki  1.23.12
LBFactorySimple Class Reference

A simple single-master LBFactory that gets its configuration from the b/c globals. More...

Inheritance diagram for LBFactorySimple:
Collaboration diagram for LBFactorySimple:

Public Member Functions

 __construct ( $conf)
 Construct a factory based on a configuration array (typically from $wgLBFactoryConf) 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...
 
getExternalLB ( $cluster, $wiki=false)
 
 getMainLB ( $wiki=false)
 
 newExternalLB ( $cluster, $wiki=false)
 
 newMainLB ( $wiki=false)
 
 shutdown ()
 Prepare all tracked load balancers for shutdown STUB. More...
 
- Public Member Functions inherited from LBFactory
 callMethod ( $loadBalancer, $methodName, $args)
 Private helper for forEachLBCallMethod. More...
 
 commitMasterChanges ()
 Commit changes on all master connections. More...
 
 forEachLBCallMethod ( $methodName, $args=array())
 Call a method of each tracked load balancer. More...
 
 hasMasterChanges ()
 Detemine if any master connection has pending changes. More...
 
 rollbackMasterChanges ()
 Rollback changes on all master connections. More...
 

Protected Attributes

ChronologyProtector $chronProt
 
LoadBalancer[] $extLBs = array()
 
LoadBalancer $mainLB
 

Additional Inherited Members

- Static Public Member Functions inherited from LBFactory
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 inherited from LBFactory
static $instance
 

Detailed Description

A simple single-master LBFactory that gets its configuration from the b/c globals.

Definition at line 220 of file LBFactory.php.

Constructor & Destructor Documentation

◆ __construct()

LBFactorySimple::__construct (   $conf)

Construct a factory based on a configuration array (typically from $wgLBFactoryConf)

Parameters
array$conf

Reimplemented from LBFactory.

Definition at line 227 of file LBFactory.php.

Member Function Documentation

◆ forEachLB()

LBFactorySimple::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.

Parameters
callable$callback
array$params

Reimplemented from LBFactory.

Definition at line 325 of file LBFactory.php.

References $lb, $params, array(), and as.

◆ getExternalLB()

& LBFactorySimple::getExternalLB (   $cluster,
  $wiki = false 
)
Parameters
string$cluster
bool | string$wiki
Returns
array

Reimplemented from LBFactory.

Definition at line 307 of file LBFactory.php.

References array(), and newExternalLB().

◆ getMainLB()

LBFactorySimple::getMainLB (   $wiki = false)
Parameters
bool | string$wiki
Returns
LoadBalancer

Reimplemented from LBFactory.

Definition at line 275 of file LBFactory.php.

References $mainLB, array(), and newMainLB().

◆ newExternalLB()

LBFactorySimple::newExternalLB (   $cluster,
  $wiki = false 
)
Exceptions
MWException
Parameters
string$cluster
bool | string$wiki
Returns
LoadBalancer

Reimplemented from LBFactory.

Definition at line 291 of file LBFactory.php.

References array(), and global.

Referenced by getExternalLB().

◆ newMainLB()

LBFactorySimple::newMainLB (   $wiki = false)
Parameters
bool | string$wiki
Returns
LoadBalancer

Reimplemented from LBFactory.

Definition at line 235 of file LBFactory.php.

References $flags, $wgDBname, array(), DBO_COMPRESS, DBO_DEBUG, DBO_DEFAULT, DBO_SSL, and global.

Referenced by getMainLB().

◆ shutdown()

LBFactorySimple::shutdown ( )

Prepare all tracked load balancers for shutdown STUB.

Reimplemented from LBFactory.

Definition at line 334 of file LBFactory.php.

References as, and LBFactory\commitMasterChanges().

Member Data Documentation

◆ $chronProt

ChronologyProtector LBFactorySimple::$chronProt
protected

Definition at line 225 of file LBFactory.php.

◆ $extLBs

LoadBalancer [] LBFactorySimple::$extLBs = array()
protected

Definition at line 223 of file LBFactory.php.

◆ $mainLB

LoadBalancer LBFactorySimple::$mainLB
protected

Definition at line 221 of file LBFactory.php.

Referenced by getMainLB().


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