registration: Handle $wgExtensionCredits inside the ExtensionProcessor
authorKunal Mehta <legoktm@member.fsf.org>
Sat, 2 Jan 2016 06:53:20 +0000 (22:53 -0800)
committerFlorianschmidtwelzow <florian.schmidt.stargatewissen@gmail.com>
Sat, 2 Jan 2016 15:43:52 +0000 (15:43 +0000)
Bug: T108269
Change-Id: I92675dac5cca52448e24902d0a5c865fd6df46d9

includes/registration/ExtensionProcessor.php
includes/registration/ExtensionRegistry.php

index 074a962..13c450a 100644 (file)
@@ -57,8 +57,7 @@ class ExtensionProcessor implements Processor {
                'wgGroupPermissions' => 'array_plus_2d',
                'wgRevokePermissions' => 'array_plus_2d',
                'wgHooks' => 'array_merge_recursive',
-               // credits are handled in the ExtensionRegistry
-               // 'wgExtensionCredits' => 'array_merge_recursive',
+               'wgExtensionCredits' => 'array_merge_recursive',
                'wgExtraGenderNamespaces' => 'array_plus',
                'wgNamespacesWithSubpages' => 'array_plus',
                'wgNamespaceContentModels' => 'array_plus',
@@ -321,6 +320,7 @@ class ExtensionProcessor implements Processor {
                }
 
                $this->credits[$name] = $credits;
+               $this->globals['wgExtensionCredits'][$credits['type']][] = $credits;
        }
 
        /**
index e37e7f5..86be86b 100644 (file)
@@ -29,7 +29,7 @@ class ExtensionRegistry {
        /**
         * Bump whenever the registration cache needs resetting
         */
-       const CACHE_VERSION = 2;
+       const CACHE_VERSION = 3;
 
        /**
         * Special key that defines the merge strategy
@@ -225,10 +225,6 @@ class ExtensionRegistry {
                $data = $processor->getExtractedInfo();
                // Need to set this so we can += to it later
                $data['globals']['wgAutoloadClasses'] = array();
-               foreach ( $data['credits'] as $credit ) {
-                       $data['globals']['wgExtensionCredits'][$credit['type']][] = $credit;
-               }
-               $data['globals']['wgExtensionCredits'][self::MERGE_STRATEGY] = 'array_merge_recursive';
                $data['autoload'] = $autoloadClasses;
                $data['autoloaderPaths'] = $autoloaderPaths;
                return $data;