MediaWiki  1.34.0
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)
 Returns the LBFactory class to use and the load balancer configuration. More...
 
static logDeprecation ( $msg)
 Log a database deprecation warning. More...
 

Static Private Member Functions

static assertValidServerConfigs (array $servers, $ldDB, $ldTP)
 
static getDbTypesWithSchemas ()
 
static initServerInfo (array $server, ServiceOptions $options)
 
static injectObjectCaches (array $lbConf, BagOStuff $sCache, BagOStuff $mStash, WANObjectCache $wCache)
 
static reportIfPrefixSet ( $prefix, $dbType)
 
static reportMismatchedDBs ( $srvDB, $ldDB)
 
static reportMismatchedPrefixes ( $srvTP, $ldTP)
 

Static Private Attributes

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

Detailed Description

MediaWiki-specific class for generating database load balancers.

Definition at line 32 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 247 of file MWLBFactory.php.

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

Referenced by applyDefaultConfig().

◆ getDbTypesWithSchemas()

static MWLBFactory::getDbTypesWithSchemas ( )
staticprivate
Returns
array

Definition at line 167 of file MWLBFactory.php.

Referenced by applyDefaultConfig().

◆ getLBFactoryClass()

static MWLBFactory::getLBFactoryClass ( array  $config)
static

Returns the LBFactory class to use and the load balancer configuration.

Todo:
instead of this, use a ServiceContainer for managing the different implementations.
Parameters
array$config(e.g. $wgLBFactoryConf)
Returns
string Class name

Definition at line 327 of file MWLBFactory.php.

References wfDeprecated().

◆ initServerInfo()

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

Definition at line 176 of file MWLBFactory.php.

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

Referenced by applyDefaultConfig().

◆ injectObjectCaches()

static MWLBFactory::injectObjectCaches ( array  $lbConf,
BagOStuff  $sCache,
BagOStuff  $mStash,
WANObjectCache  $wCache 
)
staticprivate
Parameters
array$lbConf
BagOStuff$sCache
BagOStuff$mStash
WANObjectCache$wCache
Returns
array

Definition at line 220 of file MWLBFactory.php.

References BagOStuff\getQoS(), and WANObjectCache\getQoS().

Referenced by applyDefaultConfig().

◆ logDeprecation()

static MWLBFactory::logDeprecation (   $msg)
static

Log a database deprecation warning.

Parameters
string$msgDeprecation message

Definition at line 365 of file MWLBFactory.php.

References $wgDevelopmentWarnings, and wfDebugLog().

◆ reportIfPrefixSet()

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

Definition at line 275 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 288 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 305 of file MWLBFactory.php.

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

Referenced by assertValidServerConfigs().

Member Data Documentation

◆ $loggedDeprecations

array MWLBFactory::$loggedDeprecations = []
staticprivate

Cache of already-logged deprecation messages.

Definition at line 35 of file MWLBFactory.php.


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