Make sure autoloader closures do not have a scope class set
parent
2e71896168
commit
d047f38f73
|
@ -1021,13 +1021,13 @@ REGISTER_LOADER;
|
||||||
if ($useIncludeFiles) {
|
if ($useIncludeFiles) {
|
||||||
$file .= <<<INCLUDE_FILES
|
$file .= <<<INCLUDE_FILES
|
||||||
\$filesToLoad = \Composer\Autoload\ComposerStaticInit$suffix::\$files;
|
\$filesToLoad = \Composer\Autoload\ComposerStaticInit$suffix::\$files;
|
||||||
\$requireFile = static function (\$fileIdentifier, \$file) {
|
\$requireFile = \Closure::bind(static function (\$fileIdentifier, \$file) {
|
||||||
if (empty(\$GLOBALS['__composer_autoload_files'][\$fileIdentifier])) {
|
if (empty(\$GLOBALS['__composer_autoload_files'][\$fileIdentifier])) {
|
||||||
\$GLOBALS['__composer_autoload_files'][\$fileIdentifier] = true;
|
\$GLOBALS['__composer_autoload_files'][\$fileIdentifier] = true;
|
||||||
|
|
||||||
require \$file;
|
require \$file;
|
||||||
}
|
}
|
||||||
};
|
}, null, null);
|
||||||
foreach (\$filesToLoad as \$fileIdentifier => \$file) {
|
foreach (\$filesToLoad as \$fileIdentifier => \$file) {
|
||||||
(\$requireFile)(\$fileIdentifier, \$file);
|
(\$requireFile)(\$fileIdentifier, \$file);
|
||||||
}
|
}
|
||||||
|
|
|
@ -574,8 +574,8 @@ class ClassLoader
|
||||||
* @param string $file
|
* @param string $file
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
self::$includeFile = static function($file) {
|
self::$includeFile = \Closure::bind(static function($file) {
|
||||||
include $file;
|
include $file;
|
||||||
};
|
}, null, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,13 +32,13 @@ class ComposerAutoloaderInitFilesAutoloadOrder
|
||||||
$loader->register(true);
|
$loader->register(true);
|
||||||
|
|
||||||
$filesToLoad = \Composer\Autoload\ComposerStaticInitFilesAutoloadOrder::$files;
|
$filesToLoad = \Composer\Autoload\ComposerStaticInitFilesAutoloadOrder::$files;
|
||||||
$requireFile = static function ($fileIdentifier, $file) {
|
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
|
||||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||||
|
|
||||||
require $file;
|
require $file;
|
||||||
}
|
}
|
||||||
};
|
}, null, null);
|
||||||
foreach ($filesToLoad as $fileIdentifier => $file) {
|
foreach ($filesToLoad as $fileIdentifier => $file) {
|
||||||
($requireFile)($fileIdentifier, $file);
|
($requireFile)($fileIdentifier, $file);
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,13 +32,13 @@ class ComposerAutoloaderInitFilesAutoload
|
||||||
$loader->register(true);
|
$loader->register(true);
|
||||||
|
|
||||||
$filesToLoad = \Composer\Autoload\ComposerStaticInitFilesAutoload::$files;
|
$filesToLoad = \Composer\Autoload\ComposerStaticInitFilesAutoload::$files;
|
||||||
$requireFile = static function ($fileIdentifier, $file) {
|
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
|
||||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||||
|
|
||||||
require $file;
|
require $file;
|
||||||
}
|
}
|
||||||
};
|
}, null, null);
|
||||||
foreach ($filesToLoad as $fileIdentifier => $file) {
|
foreach ($filesToLoad as $fileIdentifier => $file) {
|
||||||
($requireFile)($fileIdentifier, $file);
|
($requireFile)($fileIdentifier, $file);
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,13 +36,13 @@ class ComposerAutoloaderInitFilesAutoload
|
||||||
$loader->register(true);
|
$loader->register(true);
|
||||||
|
|
||||||
$filesToLoad = \Composer\Autoload\ComposerStaticInitFilesAutoload::$files;
|
$filesToLoad = \Composer\Autoload\ComposerStaticInitFilesAutoload::$files;
|
||||||
$requireFile = static function ($fileIdentifier, $file) {
|
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
|
||||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||||
|
|
||||||
require $file;
|
require $file;
|
||||||
}
|
}
|
||||||
};
|
}, null, null);
|
||||||
foreach ($filesToLoad as $fileIdentifier => $file) {
|
foreach ($filesToLoad as $fileIdentifier => $file) {
|
||||||
($requireFile)($fileIdentifier, $file);
|
($requireFile)($fileIdentifier, $file);
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,13 +34,13 @@ class ComposerAutoloaderInitTargetDir
|
||||||
$loader->register(true);
|
$loader->register(true);
|
||||||
|
|
||||||
$filesToLoad = \Composer\Autoload\ComposerStaticInitTargetDir::$files;
|
$filesToLoad = \Composer\Autoload\ComposerStaticInitTargetDir::$files;
|
||||||
$requireFile = static function ($fileIdentifier, $file) {
|
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
|
||||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||||
|
|
||||||
require $file;
|
require $file;
|
||||||
}
|
}
|
||||||
};
|
}, null, null);
|
||||||
foreach ($filesToLoad as $fileIdentifier => $file) {
|
foreach ($filesToLoad as $fileIdentifier => $file) {
|
||||||
($requireFile)($fileIdentifier, $file);
|
($requireFile)($fileIdentifier, $file);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue