有个问题请教一下:
在laravel 源代码:vendor/composer/autoload_real.php
require_once __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit290bf49d84893e46e6f7e0573b89e863::getInitializer($loader));
vendor/composer/autoload_static.php
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit290bf49d84893e46e6f7e0573b89e863::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit290bf49d84893e46e6f7e0573b89e863::$prefixDirsPsr4;
$loader->prefixesPsr0 = ComposerStaticInit290bf49d84893e46e6f7e0573b89e863::$prefixesPsr0;
$loader->classMap = ComposerStaticInit290bf49d84893e46e6f7e0573b89e863::$classMap;
}, null, ClassLoader::class);
}
不明白为什么要用call_user_func来调用?是因为返回的是一个闭包么?我能理解的一部分是,因为这个回调的函数名(\Composer\Autoload\ComposerStaticInit290bf49d84893e46e6f7e0573b89e863)不太确定,所以会需要用到?