MediaWiki  1.33.0
MWLBFactory Class Reference

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

Static Public Member Functions

static applyDefaultConfig (array $lbConf, Config $mainConfig, ConfiguredReadOnlyMode $readOnlyMode, BagOStuff $srvCace, 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 setSchemaAliases (LBFactory $lbFactory, Config $config)
 

Static Private Member Functions

static applyDefaultCaching (array $lbConf, BagOStuff $sCache, BagOStuff $mStash, WANObjectCache $wCache)
 
static reportIfPrefixSet ( $prefix, $dbType)
 
static reportMismatchedDBs ( $srvDB, $ldDB)
 
static reportMismatchedPrefixes ( $srvTP, $ldTP)
 
static sanityCheckServerConfig (array $servers, Config $mainConfig)
 

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

◆ applyDefaultCaching()

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

Definition at line 186 of file MWLBFactory.php.

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

Referenced by applyDefaultConfig().

◆ applyDefaultConfig()

static MWLBFactory::applyDefaultConfig ( array  $lbConf,
Config  $mainConfig,
ConfiguredReadOnlyMode  $readOnlyMode,
BagOStuff  $srvCace,
BagOStuff  $mainStash,
WANObjectCache  $wanCache 
)
static
Parameters
array$lbConfConfig for LBFactory::__construct()
Config$mainConfigMain config object from MediaWikiServices
ConfiguredReadOnlyMode$readOnlyMode
BagOStuff$srvCace
BagOStuff$mainStash
WANObjectCache$wanCache
Returns
array

Definition at line 46 of file MWLBFactory.php.

References $section, $wgCommandLineMode, applyDefaultCaching(), as, class, DBO_COMPRESS, DBO_DEBUG, DBO_DEFAULT, DBO_SSL, Config\get(), ConfiguredReadOnlyMode\getReason(), Profiler\instance(), sanityCheckServerConfig(), 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 289 of file MWLBFactory.php.

References class, and wfDeprecated().

Referenced by LBFactoryTest\testGetLBFactoryClass().

◆ logDeprecation()

static MWLBFactory::logDeprecation (   $msg)
static

Log a database deprecation warning.

Parameters
string$msgDeprecation message

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

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

Referenced by sanityCheckServerConfig().

◆ reportMismatchedDBs()

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

Definition at line 251 of file MWLBFactory.php.

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

Referenced by sanityCheckServerConfig().

◆ reportMismatchedPrefixes()

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

Definition at line 268 of file MWLBFactory.php.

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

Referenced by sanityCheckServerConfig().

◆ sanityCheckServerConfig()

static MWLBFactory::sanityCheckServerConfig ( array  $servers,
Config  $mainConfig 
)
staticprivate
Parameters
array$servers
Config$mainConfig

Definition at line 207 of file MWLBFactory.php.

References $type, as, Config\get(), reportIfPrefixSet(), reportMismatchedDBs(), and reportMismatchedPrefixes().

Referenced by applyDefaultConfig().

◆ setSchemaAliases()

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

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


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