/**
* @param array $lbConf Config for LBFactory::__construct()
* @param Config $mainConfig Main config object from MediaWikiServices
+ * @param ConfiguredReadOnlyMode $readOnlyMode
* @return array
*/
- public static function applyDefaultConfig( array $lbConf, Config $mainConfig ) {
+ public static function applyDefaultConfig( array $lbConf, Config $mainConfig,
+ ConfiguredReadOnlyMode $readOnlyMode
+ ) {
global $wgCommandLineMode;
static $typesWithSchema = [ 'postgres', 'msssql' ];
'errorLogger' => [ MWExceptionHandler::class, 'logException' ],
'cliMode' => $wgCommandLineMode,
'hostname' => wfHostname(),
- // TODO: replace the global wfConfiguredReadOnlyReason() with a service.
- 'readOnlyReason' => wfConfiguredReadOnlyReason(),
+ 'readOnlyReason' => $readOnlyMode->getReason(),
];
+ // When making changes here, remember to also specify MediaWiki-specific options
+ // for Database classes in the relevant Installer subclass.
+ // Such as MysqlInstaller::openConnection and PostgresInstaller::openConnectionWithParams.
if ( $lbConf['class'] === 'LBFactorySimple' ) {
if ( isset( $lbConf['servers'] ) ) {
// Server array is already explicitly configured; leave alone
}
$cCache = ObjectCache::getLocalClusterInstance();
if ( $cCache->getQoS( $cCache::ATTR_EMULATION ) > $cCache::QOS_EMULATION_SQL ) {
- $lbConf['memCache'] = $cCache;
+ $lbConf['memStash'] = $cCache;
}
$wCache = MediaWikiServices::getInstance()->getMainWANObjectCache();
if ( $wCache->getQoS( $wCache::ATTR_EMULATION ) > $wCache::QOS_EMULATION_SQL ) {