From 8cc0de98dd5e668e815d9901d28ba5bf94928bf6 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Sun, 2 Aug 2015 14:56:44 -0700 Subject: [PATCH] registration: Actually set the merge strategy for $wgExtensionCredits $wgExtensionCredits is special and needs to be set in the ExtensionRegistry. Also change the cache key so any bad cache entries will be ignored. Follows up 1ebb0f5659667f. Change-Id: Iec08ab8d9ef7fe7cccde979530839ef553779658 --- includes/registration/ExtensionProcessor.php | 3 ++- includes/registration/ExtensionRegistry.php | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/includes/registration/ExtensionProcessor.php b/includes/registration/ExtensionProcessor.php index 2a998835f7..68e5a17796 100644 --- a/includes/registration/ExtensionProcessor.php +++ b/includes/registration/ExtensionProcessor.php @@ -57,7 +57,8 @@ class ExtensionProcessor implements Processor { 'wgGroupPermissions' => 'array_plus_2d', 'wgRevokePermissions' => 'array_plus_2d', 'wgHooks' => 'array_merge_recursive', - 'wgExtensionCredits' => 'array_merge_recursive', + // credits are handled in the ExtensionRegistry + //'wgExtensionCredits' => 'array_merge_recursive', 'wgExtraNamespaces' => 'array_plus', 'wgExtraGenderNamespaces' => 'array_plus', 'wgNamespacesWithSubpages' => 'array_plus', diff --git a/includes/registration/ExtensionRegistry.php b/includes/registration/ExtensionRegistry.php index 7e113fc8c0..7414925f48 100644 --- a/includes/registration/ExtensionRegistry.php +++ b/includes/registration/ExtensionRegistry.php @@ -21,6 +21,11 @@ class ExtensionRegistry { */ const OLDEST_MANIFEST_VERSION = 1; + /** + * Bump whenever the registration cache needs resetting + */ + const CACHE_VERSION = 1; + /** * Special key that defines the merge strategy * @@ -109,7 +114,7 @@ class ExtensionRegistry { } // See if this queue is in APC - $key = wfMemcKey( 'registration', md5( json_encode( $this->queued ) ) ); + $key = wfMemcKey( 'registration', md5( json_encode( $this->queued ) ), self::CACHE_VERSION ); $data = $this->cache->get( $key ); if ( $data ) { $this->exportExtractedData( $data ); @@ -182,6 +187,7 @@ class ExtensionRegistry { foreach ( $data['credits'] as $credit ) { $data['globals']['wgExtensionCredits'][$credit['type']][] = $credit; } + $data['globals']['wgExtensionCredits'][self::MERGE_STRATEGY] = 'array_merge_recursive'; $data['autoload'] = $autoloadClasses; return $data; } -- 2.20.1