Merge "Use User::equals() where applicable in the class"
[lhc/web/wiklou.git] / includes / registration / ExtensionProcessor.php
index da8600c..ca84a51 100644 (file)
@@ -57,11 +57,13 @@ class ExtensionProcessor implements Processor {
                'wgGroupPermissions' => 'array_plus_2d',
                'wgRevokePermissions' => 'array_plus_2d',
                'wgHooks' => 'array_merge_recursive',
-               'wgExtensionCredits' => 'array_merge_recursive',
-               'wgExtraNamespaces' => 'array_plus',
+               // credits are handled in the ExtensionRegistry
+               //'wgExtensionCredits' => 'array_merge_recursive',
                'wgExtraGenderNamespaces' => 'array_plus',
                'wgNamespacesWithSubpages' => 'array_plus',
                'wgNamespaceContentModels' => 'array_plus',
+               'wgNamespaceProtection' => 'array_plus',
+               'wgCapitalLinkOverrides' => 'array_plus',
        );
 
        /**
@@ -210,7 +212,7 @@ class ExtensionProcessor implements Processor {
                        foreach ( $info['namespaces'] as $ns ) {
                                $id = $ns['id'];
                                $this->defines[$ns['constant']] = $id;
-                               $this->globals['wgExtraNamespaces'][$id] = $ns['name'];
+                               $this->attributes['ExtensionNamespaces'][$id] = $ns['name'];
                                if ( isset( $ns['gender'] ) ) {
                                        $this->globals['wgExtraGenderNamespaces'][$id] = $ns['gender'];
                                }
@@ -223,6 +225,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'];
+                               }
                        }
                }
        }
@@ -297,9 +305,15 @@ class ExtensionProcessor implements Processor {
         */
        protected function extractConfig( array $info ) {
                if ( isset( $info['config'] ) ) {
+                       if ( isset( $info['config']['_prefix'] ) ) {
+                               $prefix = $info['config']['_prefix'];
+                               unset( $info['config']['_prefix'] );
+                       } else {
+                               $prefix = 'wg';
+                       }
                        foreach ( $info['config'] as $key => $val ) {
                                if ( $key[0] !== '@' ) {
-                                       $this->globals["wg$key"] = $val;
+                                       $this->globals["$prefix$key"] = $val;
                                }
                        }
                }