$autoloadNamespaces
);
- if ( isset( $info['AutoloadClasses'] ) ) {
- $autoload = $this->processAutoLoader( $dir, $info['AutoloadClasses'] );
- $GLOBALS['wgAutoloadClasses'] += $autoload;
- $autoloadClasses += $autoload;
- }
- if ( isset( $info['AutoloadNamespaces'] ) ) {
- $autoloadNamespaces += $this->processAutoLoader( $dir, $info['AutoloadNamespaces'] );
- AutoLoader::$psr4Namespaces += $autoloadNamespaces;
- }
-
// get all requirements/dependencies for this extension
$requires = $processor->getRequirements( $info, $this->checkDev );
wfRequireOnceInGlobalScope( "$IP/includes/DefaultSettings.php" );
wfRequireOnceInGlobalScope( "$IP/includes/GlobalFunctions.php" );
-// Load extensions/skins present in filesystem so that classes can be discovered.
+// Populate classes and namespaces from extensions and skins present in filesystem.
$directoryToJsonMap = [
- 'extensions' => [ 'extension.json', 'extension-wip.json' ],
- 'skins' => [ 'skin.json', 'skin-wip.json' ]
+ $GLOBALS['wgExtensionDirectory'] => [ 'extension.json', 'extension-wip.json' ],
+ $GLOBALS['wgStyleDirectory'] => [ 'skin.json', 'skin-wip.json' ]
];
foreach ( $directoryToJsonMap as $directory => $jsonFile ) {
- foreach ( new DirectoryIterator( __DIR__ . '/../../' . $directory ) as $iterator ) {
+ foreach ( new DirectoryIterator( $directory ) as $iterator ) {
foreach ( $jsonFile as $file ) {
+
$jsonPath = $iterator->getPathname() . '/' . $file;
if ( file_exists( $jsonPath ) ) {
+ // ExtensionRegistry->readFromQueue is not used as it checks extension/skin
+ // dependencies, which we don't need or want for unit tests.
$json = file_get_contents( $jsonPath );
$info = json_decode( $json, true );
$dir = dirname( $jsonPath );