From a1789ddde42033f1b05cc4929491214ee6e79383 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 17 Dec 2015 09:15:42 +0100 Subject: Update to MediaWiki 1.26.0 --- includes/registration/ExtensionProcessor.php | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'includes/registration/ExtensionProcessor.php') diff --git a/includes/registration/ExtensionProcessor.php b/includes/registration/ExtensionProcessor.php index 0b594b42..a286f6bf 100644 --- a/includes/registration/ExtensionProcessor.php +++ b/includes/registration/ExtensionProcessor.php @@ -62,6 +62,8 @@ class ExtensionProcessor implements Processor { 'wgExtraGenderNamespaces' => 'array_plus', 'wgNamespacesWithSubpages' => 'array_plus', 'wgNamespaceContentModels' => 'array_plus', + 'wgNamespaceProtection' => 'array_plus', + 'wgCapitalLinkOverrides' => 'array_plus', ); /** @@ -144,9 +146,10 @@ class ExtensionProcessor implements Processor { /** * @param string $path * @param array $info + * @param int $version manifest_version for info * @return array */ - public function extractInfo( $path, array $info ) { + public function extractInfo( $path, array $info, $version ) { $this->extractConfig( $info ); $this->extractHooks( $info ); $dir = dirname( $path ); @@ -189,6 +192,16 @@ class ExtensionProcessor implements Processor { ); } + public function getRequirements( array $info ) { + $requirements = array(); + $key = ExtensionRegistry::MEDIAWIKI_CORE; + if ( isset( $info['requires'][$key] ) ) { + $requirements[$key] = $info['requires'][$key]; + } + + return $requirements; + } + protected function extractHooks( array $info ) { if ( isset( $info['Hooks'] ) ) { foreach ( $info['Hooks'] as $name => $value ) { @@ -222,6 +235,12 @@ class ExtensionProcessor implements Processor { if ( isset( $ns['defaultcontentmodel'] ) ) { $this->globals['wgNamespaceContentModels'][$id] = $ns['defaultcontentmodel']; } + if ( isset( $ns['protection'] ) ) { + $this->globals['wgNamespaceProtection'][$id] = $ns['protection']; + } + if ( isset( $ns['capitallinkoverride'] ) ) { + $this->globals['wgCapitalLinkOverrides'][$id] = $ns['capitallinkoverride']; + } } } } @@ -320,10 +339,14 @@ class ExtensionProcessor implements Processor { /** * @param string $name - * @param mixed $value + * @param array $value * @param array &$array + * @throws InvalidArgumentException */ protected function storeToArray( $name, $value, &$array ) { + if ( !is_array( $value ) ) { + throw new InvalidArgumentException( "The value for '$name' should be an array" ); + } if ( isset( $array[$name] ) ) { $array[$name] = array_merge_recursive( $array[$name], $value ); } else { -- cgit v1.2.3-54-g00ecf