Merge "Add 3D filetype for STL files"
[lhc/web/wiklou.git] / includes / registration / ExtensionProcessor.php
index d14be3f..39a8a3d 100644 (file)
@@ -308,8 +308,15 @@ class ExtensionProcessor implements Processor {
        protected function extractNamespaces( array $info ) {
                if ( isset( $info['namespaces'] ) ) {
                        foreach ( $info['namespaces'] as $ns ) {
-                               $id = $ns['id'];
-                               $this->defines[$ns['constant']] = $id;
+                               if ( defined( $ns['constant'] ) ) {
+                                       // If the namespace constant is already defined, use it.
+                                       // This allows namespace IDs to be overwritten locally.
+                                       $id = constant( $ns['constant'] );
+                               } else {
+                                       $id = $ns['id'];
+                                       $this->defines[ $ns['constant'] ] = $id;
+                               }
+
                                if ( !( isset( $ns['conditional'] ) && $ns['conditional'] ) ) {
                                        // If it is not conditional, register it
                                        $this->attributes['ExtensionNamespaces'][$id] = $ns['name'];