From: Kunal Mehta Date: Tue, 27 Jan 2015 07:00:07 +0000 (-0800) Subject: registration: Ignore keys prefixed with @ in "config" X-Git-Tag: 1.31.0-rc.0~12593 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=920ef42ae0923219ac42eef8d0822726834c5a9e;p=lhc%2Fweb%2Fwiklou.git registration: Ignore keys prefixed with @ in "config" This will allow for documentation of individual configuration options. Change-Id: I180bc742c96985c2a8358aef814d993fca9aba84 --- diff --git a/includes/registration/ExtensionProcessor.php b/includes/registration/ExtensionProcessor.php index fe86ca927b..25222f6568 100644 --- a/includes/registration/ExtensionProcessor.php +++ b/includes/registration/ExtensionProcessor.php @@ -237,7 +237,9 @@ class ExtensionProcessor implements Processor { protected function extractConfig( array $info ) { if ( isset( $info['config'] ) ) { foreach ( $info['config'] as $key => $val ) { - $this->globals["wg$key"] = $val; + if ( $key[0] !== '@' ) { + $this->globals["wg$key"] = $val; + } } $this->processed[] = 'config'; } diff --git a/tests/phpunit/includes/registration/ExtensionProcessorTest.php b/tests/phpunit/includes/registration/ExtensionProcessorTest.php index e57c2b340a..96df354b01 100644 --- a/tests/phpunit/includes/registration/ExtensionProcessorTest.php +++ b/tests/phpunit/includes/registration/ExtensionProcessorTest.php @@ -87,12 +87,14 @@ class ExtensionProcessorTest extends MediaWikiTestCase { 'config' => array( 'Bar' => 'somevalue', 'Foo' => 10, + '@IGNORED' => 'yes', ), ) + self::$default; $processor->extractInfo( $this->dir, $info ); $extracted = $processor->getExtractedInfo(); $this->assertEquals( 'somevalue', $extracted['globals']['wgBar'] ); $this->assertEquals( 10, $extracted['globals']['wgFoo'] ); + $this->assertArrayNotHasKey( 'wg@IGNORED', $extracted['globals'] ); } public static function provideSetToGlobal() {