Provide cookie workaround for setting the feature flag

This is a convenient way to propagate alternate configuration during
browser testing.

Bug: T270240
Change-Id: Ica6399c53499be7f930e8d13b838ad265b66cdf4
This commit is contained in:
Adam Wight 2021-01-04 13:48:42 +01:00
parent 1ea61ad2aa
commit 88fd6a4e28

View file

@ -54,7 +54,11 @@ class CodeMirrorHooks {
public static function onResourceLoaderGetConfigVars( array &$vars ) { public static function onResourceLoaderGetConfigVars( array &$vars ) {
/** @var Config $config */ /** @var Config $config */
$config = MediaWikiServices::getInstance()->getMainConfig(); $config = MediaWikiServices::getInstance()->getMainConfig();
$vars['wgCodeMirrorEnableBracketMatching'] = $config->get( 'CodeMirrorEnableBracketMatching' );
$vars['wgCodeMirrorEnableBracketMatching'] = $config->get( 'CodeMirrorEnableBracketMatching' )
// Allows tests to override the configuration.
|| RequestContext::getMain()->getRequest()
->getCookie( '-codemirror-bracket-matching-test', 'mw' );
} }
/** /**