registration: Initialize PSR-4 namespaces at same stage as normal autoloader
[lhc/web/wiklou.git] / includes / registration / ExtensionRegistry.php
index 1876645..0eb6a9b 100644 (file)
@@ -202,6 +202,7 @@ class ExtensionRegistry {
         * @param array $queue keys are filenames, values are ignored
         * @return array extracted info
         * @throws Exception
+        * @throws ExtensionDependencyError
         */
        public function readFromQueue( array $queue ) {
                global $wgVersion;
@@ -245,6 +246,7 @@ class ExtensionRegistry {
                        }
                        if ( isset( $info['AutoloadNamespaces'] ) ) {
                                $autoloadNamespaces += $this->processAutoLoader( $dir, $info['AutoloadNamespaces'] );
+                               AutoLoader::$psr4Namespaces += $autoloadNamespaces;
                        }
 
                        // get all requirements/dependencies for this extension
@@ -273,11 +275,7 @@ class ExtensionRegistry {
                );
 
                if ( $incompatible ) {
-                       if ( count( $incompatible ) === 1 ) {
-                               throw new Exception( $incompatible[0] );
-                       } else {
-                               throw new Exception( implode( "\n", $incompatible ) );
-                       }
+                       throw new ExtensionDependencyError( $incompatible );
                }
 
                // Need to set this so we can += to it later