MediaWiki fundraising/REL1_35
MWLBFactory Class Reference

MediaWiki-specific class for generating database load balancers. More...

Static Public Member Functions

static applyDefaultConfig (array $lbConf, ServiceOptions $options, ConfiguredReadOnlyMode $readOnlyMode, BagOStuff $srvCache, BagOStuff $mainStash, WANObjectCache $wanCache)
 
static getLBFactoryClass (array $config)
 Decide which LBFactory class to use.
 
static logDeprecation ( $msg)
 Log a database deprecation warning.
 
static setDomainAliases (ILBFactory $lbFactory)
 

Static Private Member Functions

static assertValidServerConfigs (array $servers, $ldDB, $ldTP)
 
static getDbTypesWithSchemas ()
 
static initServerInfo (array $server, ServiceOptions $options)
 
static reportIfPrefixSet ( $prefix, $dbType)
 
static reportMismatchedDBs ( $srvDB, $ldDB)
 
static reportMismatchedPrefixes ( $srvTP, $ldTP)
 

Static Private Attributes

static array $loggedDeprecations = []
 Cache of already-logged deprecation messages.
 

Detailed Description

MediaWiki-specific class for generating database load balancers.

Definition at line 33 of file MWLBFactory.php.

Member Function Documentation

◆ applyDefaultConfig()

static MWLBFactory::applyDefaultConfig ( array $lbConf,
ServiceOptions $options,
ConfiguredReadOnlyMode $readOnlyMode,
BagOStuff $srvCache,
BagOStuff $mainStash,
WANObjectCache $wanCache )
static

◆ assertValidServerConfigs()

static MWLBFactory::assertValidServerConfigs ( array $servers,
$ldDB,
$ldTP )
staticprivate
Parameters
array$servers
string$ldDBLocal domain database name
string$ldTPLocal domain prefix

Definition at line 232 of file MWLBFactory.php.

References $type, reportIfPrefixSet(), reportMismatchedDBs(), and reportMismatchedPrefixes().

Referenced by applyDefaultConfig().

◆ getDbTypesWithSchemas()

static MWLBFactory::getDbTypesWithSchemas ( )
staticprivate
Returns
array

Definition at line 170 of file MWLBFactory.php.

Referenced by applyDefaultConfig().

◆ getLBFactoryClass()

static MWLBFactory::getLBFactoryClass ( array $config)
static

Decide which LBFactory class to use.

Definition at line 310 of file MWLBFactory.php.

◆ initServerInfo()

static MWLBFactory::initServerInfo ( array $server,
ServiceOptions $options )
staticprivate
Parameters
array$server
ServiceOptions$options
Returns
array

Definition at line 179 of file MWLBFactory.php.

References DBO_DEBUG, DBO_DEFAULT, MediaWiki\Config\ServiceOptions\get(), and MW_ENTRY_POINT.

Referenced by applyDefaultConfig().

◆ logDeprecation()

static MWLBFactory::logDeprecation ( $msg)
static

Log a database deprecation warning.

Parameters
string$msgDeprecation message

Definition at line 345 of file MWLBFactory.php.

References wfGetCaller().

◆ reportIfPrefixSet()

static MWLBFactory::reportIfPrefixSet ( $prefix,
$dbType )
staticprivate
Parameters
string$prefixTable prefix
string$dbTypeDatabase type

Definition at line 260 of file MWLBFactory.php.

References MWExceptionRenderer\AS_PRETTY, and MWExceptionRenderer\output().

Referenced by assertValidServerConfigs().

◆ reportMismatchedDBs()

static MWLBFactory::reportMismatchedDBs ( $srvDB,
$ldDB )
staticprivate
Parameters
string$srvDBServer config database
string$ldDBLocal DB domain database

Definition at line 273 of file MWLBFactory.php.

References MWExceptionRenderer\AS_PRETTY, and MWExceptionRenderer\output().

Referenced by assertValidServerConfigs().

◆ reportMismatchedPrefixes()

static MWLBFactory::reportMismatchedPrefixes ( $srvTP,
$ldTP )
staticprivate
Parameters
string$srvTPServer config table prefix
string$ldTPLocal DB domain database

Definition at line 290 of file MWLBFactory.php.

References MWExceptionRenderer\AS_PRETTY, and MWExceptionRenderer\output().

Referenced by assertValidServerConfigs().

◆ setDomainAliases()

static MWLBFactory::setDomainAliases ( ILBFactory $lbFactory)
static
Parameters
ILBFactory$lbFactory

Definition at line 329 of file MWLBFactory.php.

References Wikimedia\Rdbms\ILBFactory\getLocalDomainID(), and Wikimedia\Rdbms\ILBFactory\setDomainAliases().

Member Data Documentation

◆ $loggedDeprecations

array MWLBFactory::$loggedDeprecations = []
staticprivate

Cache of already-logged deprecation messages.

Definition at line 36 of file MWLBFactory.php.


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