MediaWiki REL1_31
MWLBFactory Class Reference

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

Static Public Member Functions

static applyDefaultConfig (array $lbConf, Config $mainConfig, ConfiguredReadOnlyMode $readOnlyMode)
 
static getLBFactoryClass (array $config)
 Returns the LBFactory class to use and the load balancer configuration.
 
static logDeprecation ( $msg)
 Log a database deprecation warning.
 
static setSchemaAliases (LBFactory $lbFactory, Config $config)
 

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,
Config  $mainConfig,
ConfiguredReadOnlyMode  $readOnlyMode 
)
static
Parameters
array$lbConfConfig for LBFactory::__construct()
Config$mainConfigMain config object from MediaWikiServices
ConfiguredReadOnlyMode$readOnlyMode
Returns
array

Definition at line 44 of file MWLBFactory.php.

References $services, $wgCommandLineMode, as, DBO_COMPRESS, DBO_DEBUG, DBO_DEFAULT, DBO_SSL, Config\get(), ConfiguredReadOnlyMode\getReason(), global, and wfHostname().

◆ 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 178 of file MWLBFactory.php.

References wfDeprecated().

Referenced by LBFactoryTest\testGetLBFactoryClass().

◆ logDeprecation()

static MWLBFactory::logDeprecation (   $msg)
static

Log a database deprecation warning.

Parameters
string$msgDeprecation message

Definition at line 239 of file MWLBFactory.php.

References $wgDevelopmentWarnings, global, and wfDebugLog().

◆ setSchemaAliases()

static MWLBFactory::setSchemaAliases ( LBFactory  $lbFactory,
Config  $config 
)
static

Definition at line 211 of file MWLBFactory.php.

References Config\get(), and Wikimedia\Rdbms\LBFactory\setIndexAliases().

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: