MediaWiki REL1_37
|
MediaWiki-specific class for generating database load balancers. More...
Static Public Member Functions | |
static | applyDefaultConfig (array $lbConf, ServiceOptions $options, ConfiguredReadOnlyMode $readOnlyMode, BagOStuff $cpStash, BagOStuff $srvCache, WANObjectCache $wanCache, CriticalSectionProvider $csProvider) |
static | applyGlobalState (ILBFactory $lbFactory, Config $config, IBufferingStatsdDataFactory $stats) |
Apply global state from the current web request or other PHP process. | |
static | getLBFactoryClass (array $config) |
Decide which LBFactory class to use. | |
static | logDeprecation ( $msg) |
Log a database deprecation warning. | |
static | setDomainAliases (ILBFactory $lbFactory) |
Public Attributes | |
const | APPLY_DEFAULT_CONFIG_OPTIONS |
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. | |
MediaWiki-specific class for generating database load balancers.
Definition at line 39 of file MWLBFactory.php.
|
static |
array | $lbConf | Config for LBFactory::__construct() |
ServiceOptions | $options | |
ConfiguredReadOnlyMode | $readOnlyMode | |
BagOStuff | $cpStash | |
BagOStuff | $srvCache | |
WANObjectCache | $wanCache | |
CriticalSectionProvider | $csProvider |
Definition at line 79 of file MWLBFactory.php.
References $wgCommandLineMode, MediaWiki\Config\ServiceOptions\assertRequiredOptions(), assertValidServerConfigs(), DBO_COMPRESS, DBO_SSL, MediaWiki\Config\ServiceOptions\get(), getDbTypesWithSchemas(), ConfiguredReadOnlyMode\getReason(), and initServerInfo().
|
static |
Apply global state from the current web request or other PHP process.
This technically violates the principle constraint on ServiceWiring to be deterministic for a given site configuration. The exemption made here is solely to aid in debugging and influence non-nominal behaviour such as ChronologyProtector. That is, the state applied here must never change the logical destination or meaning of any database-related methods, it merely applies preferences and debugging information.
The code here must be non-essential, with LBFactory behaving the same toward its consumers regardless of whether this is applied or not.
For example, something may instantiate LBFactory for the current wiki without calling this, and its consumers must not be able to tell the difference. Likewise, in the future MediaWiki may instantiate service wiring and LBFactory for a foreign wiki in the same farm and apply the current global state to that, and that should be fine as well.
ILBFactory | $lbFactory | |
Config | $config | |
IBufferingStatsdDataFactory | $stats |
Definition at line 369 of file MWLBFactory.php.
|
staticprivate |
array | $servers | |
string | $ldDB | Local domain database name |
string | $ldTP | Local domain prefix |
Definition at line 235 of file MWLBFactory.php.
References $type, reportIfPrefixSet(), reportMismatchedDBs(), and reportMismatchedPrefixes().
Referenced by applyDefaultConfig().
|
staticprivate |
|
static |
Decide which LBFactory class to use.
array | $config | (e.g. $wgLBFactoryConf) |
Definition at line 316 of file MWLBFactory.php.
|
staticprivate |
array | $server | |
ServiceOptions | $options |
Definition at line 186 of file MWLBFactory.php.
References DBO_DEBUG, DBO_DEFAULT, MediaWiki\Config\ServiceOptions\get(), and MW_ENTRY_POINT.
Referenced by applyDefaultConfig().
|
static |
Log a database deprecation warning.
string | $msg | Deprecation message |
Definition at line 450 of file MWLBFactory.php.
References wfGetCaller().
|
staticprivate |
string | $prefix | Table prefix |
string | $dbType | Database type |
Definition at line 264 of file MWLBFactory.php.
References MWExceptionRenderer\AS_PRETTY, and MWExceptionRenderer\output().
Referenced by assertValidServerConfigs().
|
staticprivate |
string | $srvDB | Server config database |
string | $ldDB | Local DB domain database |
Definition at line 278 of file MWLBFactory.php.
References MWExceptionRenderer\AS_PRETTY, and MWExceptionRenderer\output().
Referenced by assertValidServerConfigs().
|
staticprivate |
string | $srvTP | Server config table prefix |
string | $ldTP | Local DB domain database |
Definition at line 296 of file MWLBFactory.php.
References MWExceptionRenderer\AS_PRETTY, and MWExceptionRenderer\output().
Referenced by assertValidServerConfigs().
|
static |
ILBFactory | $lbFactory |
Definition at line 335 of file MWLBFactory.php.
References Wikimedia\Rdbms\ILBFactory\getLocalDomainID(), and Wikimedia\Rdbms\ILBFactory\setDomainAliases().
|
staticprivate |
Cache of already-logged deprecation messages.
Definition at line 42 of file MWLBFactory.php.
const MWLBFactory::APPLY_DEFAULT_CONFIG_OPTIONS |
Definition at line 47 of file MWLBFactory.php.