1
0
Fork 0

Add loading of files autoload section for plugins and Composer runtime autoloaders (#10065)

pull/10275/head
Nicolas Grekas 2021-11-10 21:37:33 +01:00 committed by GitHub
parent b09a39f9c8
commit 8553c6d978
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 0 deletions

View File

@ -611,6 +611,12 @@ EOF;
}
}
if (isset($autoloads['files'])) {
foreach ($autoloads['files'] as $fileIdentifier => $file) {
composerRequire($fileIdentifier, $file);
}
}
return $loader;
}
@ -1393,3 +1399,12 @@ INITIALIZER;
return $sortedPackageMap;
}
}
function composerRequire($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
}
}