MediaWiki  1.23.2
LBFactoryFake Class Reference

LBFactory class that throws an error on any attempt to use it. More...

Inheritance diagram for LBFactoryFake:
Collaboration diagram for LBFactoryFake:

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)
 Get a cached (tracked) load balancer for external storage. More...
 
 getMainLB ( $wiki=false)
 Get a cached (tracked) load balancer object. More...
 
 newExternalLB ( $cluster, $wiki=false)
 Create a new load balancer for external storage. More...
 
 newMainLB ( $wiki=false)
 Create a new load balancer object. 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...
 
 shutdown ()
 Prepare all tracked load balancers for shutdown STUB. More...
 

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

LBFactory class that throws an error on any attempt to use it.

This will typically be done via wfGetDB(). Call LBFactory::disableBackend() to start using this, and LBFactory::enableBackend() to return to normal behavior

Definition at line 352 of file LBFactory.php.

Constructor & Destructor Documentation

◆ __construct()

LBFactoryFake::__construct (   $conf)

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

Parameters
array$conf

Reimplemented from LBFactory.

Definition at line 353 of file LBFactory.php.

Member Function Documentation

◆ forEachLB()

LBFactoryFake::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 372 of file LBFactory.php.

◆ getExternalLB()

& LBFactoryFake::getExternalLB (   $cluster,
  $wiki = false 
)

Get a cached (tracked) load balancer for external storage.

Parameters
string$clusterexternal storage cluster, or false for core
bool | string$wikiWiki ID, or false for the current wiki
Returns
LoadBalancer

Reimplemented from LBFactory.

Definition at line 368 of file LBFactory.php.

◆ getMainLB()

LBFactoryFake::getMainLB (   $wiki = false)

Get a cached (tracked) load balancer object.

Parameters
bool | string$wikiWiki ID, or false for the current wiki
Returns
LoadBalancer

Reimplemented from LBFactory.

Definition at line 360 of file LBFactory.php.

◆ newExternalLB()

LBFactoryFake::newExternalLB (   $cluster,
  $wiki = false 
)

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.

Parameters
string$clusterExternal storage cluster, or false for core
bool | string$wikiWiki ID, or false for the current wiki
Returns
LoadBalancer

Reimplemented from LBFactory.

Definition at line 364 of file LBFactory.php.

◆ newMainLB()

LBFactoryFake::newMainLB (   $wiki = false)

Create a new load balancer object.

The resulting object will be untracked, not chronology-protected, and the caller is responsible for cleaning it up.

Parameters
bool | string$wikiWiki ID, or false for the current wiki
Returns
LoadBalancer

Reimplemented from LBFactory.

Definition at line 356 of file LBFactory.php.


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