From ebe895d0398d2ec0a27440a87545773ae2b22f92 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Wed, 30 May 2018 21:02:46 +0200 Subject: [PATCH] registration: Initialize PSR-4 namespaces at same stage as normal autoloader readFromQueue() injects the content of AutoloadClasses to $wgAutoloadClasses however it missed doing the same for AutoloadNamespaces. When using the installer with an extension having AutoloadNamespaces set, its classes would not be found. Make ExtensionRegistry append to AutoLoader::$psr4Namespaces, and add a test to cover the new behavior. Bug: T195783 Change-Id: Id61155867a4ca7d9bc4a347f8671da74b0fa490b (cherry picked from commit 224864ebddab2e448f9ae4f247b85c652d9df42e) --- includes/registration/ExtensionRegistry.php | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/registration/ExtensionRegistry.php b/includes/registration/ExtensionRegistry.php index b000dc11b1..0eb6a9bb7f 100644 --- a/includes/registration/ExtensionRegistry.php +++ b/includes/registration/ExtensionRegistry.php @@ -246,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 -- 2.20.1