-
-
Save mainframe98/c449ef71bb87cdbc337dd7c55dc6defc to your computer and use it in GitHub Desktop.
Override ConfigFactory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$services->redefineService( | |
'ConfigFactory', | |
function ( MediaWikiServices $services ) { | |
// Use the bootstrap config to initialize the ConfigFactory. | |
$bootstrapConfig = $services->getBootstrapConfig(); | |
/** @var array $registry */ | |
$registry = $bootstrapConfig->get( 'ConfigRegistry' ); | |
/** @var Config\SetConfigurationFactory $setFactory */ | |
$setFactory = $services->getService( 'SetConfigurationFactory' ); | |
$factory = new ConfigFactory( $setFactory ); | |
foreach ( $registry as $name => $callback ) { | |
$factory->register( $name, $callback ); | |
} | |
return $factory; | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'd need the MainWANObjectCache service on line 10. It will call the MainConfig service, which in turn will call the ConfigFactory provided by MediaWiki, which I wish to override.