MediaWiki REL1_27
LBFactorySingle Class Reference

An LBFactory class that always returns a single database object. More...

Inheritance diagram for LBFactorySingle:
Collaboration diagram for LBFactorySingle:

Public Member Functions

 __construct (array $conf)
 
 forEachLB ( $callback, array $params=[])
 
getExternalLB ( $cluster, $wiki=false)
 
 getMainLB ( $wiki=false)
 
 newMainLB ( $wiki=false)
 
- Public Member Functions inherited from LBFactory
 commitAll ( $fname=__METHOD__)
 Commit on all connections.
 
 commitMasterChanges ( $fname=__METHOD__, array $options=[])
 Commit changes on all master connections.
 
 disableChronologyProtection ()
 Disable the ChronologyProtector for all load balancers.
 
 hasMasterChanges ()
 Determine if any master connection has pending changes.
 
 hasOrMadeRecentMasterChanges ()
 Determine if any master connection has pending/written changes from this request.
 
 laggedSlaveUsed ()
 Detemine if any lagged slave connection was used.
 
 rollbackMasterChanges ( $fname=__METHOD__)
 Rollback changes on all master connections.
 
 shutdown ( $flags=0)
 Prepare all tracked load balancers for shutdown.
 
 waitForReplication (array $opts=[])
 Waits for the slave DBs to catch up to the current master position.
 

Protected Member Functions

 newExternalLB ( $cluster, $wiki=false)
 
- Protected Member Functions inherited from LBFactory
 newChronologyProtector ()
 
 shutdownChronologyProtector (ChronologyProtector $cp)
 

Private Attributes

LoadBalancerSingle $lb
 

Additional Inherited Members

- Static Public Member Functions inherited from LBFactory
static destroyInstance ()
 Shut down, close connections and destroy the cached instance.
 
static disableBackend ()
 Disables all access to the load balancer, will cause all database access to throw a DBAccessError.
 
static getLBFactoryClass (array $config)
 Returns the LBFactory class to use and the load balancer configuration.
 
static setInstance ( $instance)
 Set the instance to be the given object.
 
static singleton ()
 Get an LBFactory instance.
 
- Public Attributes inherited from LBFactory
const SHUTDOWN_NO_CHRONPROT = 1
 
- Protected Attributes inherited from LBFactory
ChronologyProtector $chronProt
 
LoggerInterface $logger
 
string bool $readOnlyReason = false
 Reason all LBs are read-only or false if not.
 
TransactionProfiler $trxProfiler
 

Detailed Description

An LBFactory class that always returns a single database object.

Definition at line 27 of file LBFactorySingle.php.

Constructor & Destructor Documentation

◆ __construct()

LBFactorySingle::__construct ( array  $conf)
Parameters
array$confAn associative array with one member:

Reimplemented from LBFactory.

Definition at line 35 of file LBFactorySingle.php.

Member Function Documentation

◆ forEachLB()

LBFactorySingle::forEachLB (   $callback,
array  $params = [] 
)
Parameters
string | callable$callback
array$params

Reimplemented from LBFactory.

Definition at line 82 of file LBFactorySingle.php.

References $params.

◆ getExternalLB()

& LBFactorySingle::getExternalLB (   $cluster,
  $wiki = false 
)
Parameters
string$clusterExternal storage cluster, or false for core
bool | string$wikiWiki ID, or false for the current wiki
Returns
LoadBalancerSingle

Reimplemented from LBFactory.

Definition at line 74 of file LBFactorySingle.php.

References $lb.

◆ getMainLB()

LBFactorySingle::getMainLB (   $wiki = false)
Parameters
bool | string$wiki
Returns
LoadBalancerSingle

Reimplemented from LBFactory.

Definition at line 56 of file LBFactorySingle.php.

References $lb.

◆ newExternalLB()

LBFactorySingle::newExternalLB (   $cluster,
  $wiki = false 
)
protected
Parameters
string$clusterExternal storage cluster, or false for core
bool | string$wikiWiki ID, or false for the current wiki
Returns
LoadBalancerSingle

Reimplemented from LBFactory.

Definition at line 65 of file LBFactorySingle.php.

References $lb.

◆ newMainLB()

LBFactorySingle::newMainLB (   $wiki = false)
Parameters
bool | string$wiki
Returns
LoadBalancerSingle

Reimplemented from LBFactory.

Definition at line 48 of file LBFactorySingle.php.

References $lb.

Member Data Documentation

◆ $lb

LoadBalancerSingle LBFactorySingle::$lb
private

Definition at line 29 of file LBFactorySingle.php.

Referenced by getExternalLB(), getMainLB(), newExternalLB(), and newMainLB().


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