r39583 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r39582‎ | r39583 | r39584 >
Date:12:50, 18 August 2008
Author:werdna
Status:old
Tags:
Comment:
Allow use of +setting to add to that setting as it is (for arrays), rather than to replace it. Together with the previous commit to this file, we don't need to use groupOverrides/groupOverrides2 anymore
Modified paths:
  • /trunk/phase3/includes/SiteConfiguration.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SiteConfiguration.php
@@ -178,7 +178,16 @@
179179 function extractGlobal( $setting, $wiki, $suffix, $params, $wikiTags = array() ) {
180180 $value = $this->get( $setting, $wiki, $suffix, $params, $wikiTags );
181181 if ( !is_null( $value ) ) {
182 - $GLOBALS[$setting] = $value;
 182+ if (substr($setting,0,1) == '+' && is_array($value)) {
 183+ $setting = substr($setting,1);
 184+ if ( is_array($GLOBALS[$setting]) ) {
 185+ $GLOBALS[$setting] = array_merge( $GLOBALS[$setting], $value );
 186+ } else {
 187+ $GLOBALS[$setting] = $value;
 188+ }
 189+ } else {
 190+ $GLOBALS[$setting] = $value;
 191+ }
183192 }
184193 }
185194

Status & tagging log