Yurik has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/316523

Change subject: Use array_replace_recursive to merge jsonconfigs
......................................................................

Use array_replace_recursive to merge jsonconfigs

Change-Id: I830bfa81ee882029b9017e141d73182556ebb1cf
---
M includes/JCSingleton.php
1 file changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/JsonConfig 
refs/changes/23/316523/1

diff --git a/includes/JCSingleton.php b/includes/JCSingleton.php
index 15d98c8..7adb634 100644
--- a/includes/JCSingleton.php
+++ b/includes/JCSingleton.php
@@ -69,8 +69,8 @@
                list( self::$titleMap, self::$namespaces ) = 
self::parseConfiguration(
                        $wgNamespaceContentModels,
                        $wgContentHandlers,
-                       \ExtensionRegistry::getInstance()->getAttribute( 
'JsonConfigs' ) + $wgJsonConfigs,
-                       \ExtensionRegistry::getInstance()->getAttribute( 
'JsonConfigModels' ) + $wgJsonConfigModels
+                       array_replace_recursive( 
\ExtensionRegistry::getInstance()->getAttribute( 'JsonConfigs' ), 
$wgJsonConfigs ),
+                       array_replace_recursive( 
\ExtensionRegistry::getInstance()->getAttribute( 'JsonConfigModels' ), 
$wgJsonConfigModels )
                );
        }
 
@@ -384,7 +384,7 @@
 
        public static function getContentClass( $modelId ) {
                global $wgJsonConfigModels;
-               $configModels = 
\ExtensionRegistry::getInstance()->getAttribute( 'JsonConfigModels' ) + 
$wgJsonConfigModels;
+               $configModels = array_replace_recursive( 
\ExtensionRegistry::getInstance()->getAttribute( 'JsonConfigModels' ), 
$wgJsonConfigModels );
                $class = null;
                if ( array_key_exists( $modelId, $configModels ) ) {
                        $value = $configModels[$modelId];
@@ -579,7 +579,7 @@
                }
 
                self::init();
-               $models = \ExtensionRegistry::getInstance()->getAttribute( 
'JsonConfigModels' ) + $wgJsonConfigModels;
+               $models = array_replace_recursive( 
\ExtensionRegistry::getInstance()->getAttribute( 'JsonConfigModels' ), 
$wgJsonConfigModels );
                if ( array_key_exists( $modelId, $models ) ) {
                        // This is one of our model IDs
                        $handler = new JCContentHandler( $modelId );
@@ -784,7 +784,7 @@
                if ( $isStorage === null ) {
                        global $wgJsonConfigs;
                        $isStorage = false;
-                       $configs = 
\ExtensionRegistry::getInstance()->getAttribute( 'JsonConfigs' ) + 
$wgJsonConfigs;
+                       $configs = array_replace_recursive( 
\ExtensionRegistry::getInstance()->getAttribute( 'JsonConfigs' ), 
$wgJsonConfigs );
                        foreach ( $configs as $jc ) {
                                if ( ( !array_key_exists( 'isLocal', $jc ) || 
$jc['isLocal'] ) ||
                                         ( array_key_exists( 'store', $jc ) )

-- 
To view, visit https://gerrit.wikimedia.org/r/316523
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I830bfa81ee882029b9017e141d73182556ebb1cf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/JsonConfig
Gerrit-Branch: master
Gerrit-Owner: Yurik <yu...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to