Symfony 中的自动加载

The autoload in Symfony

在 vendor/composer/autoload_real.php 在 symfony 项目中,函数 getLoader 从 autoload.php

调用

在这个函数中,我有:

spl_autoload_register(array('ComposerAutoloaderInit374429f4ab4935127e2d36a0613c8d3a', 'loadClassLoader'), true, true);

spl_autoload_register注册两个autoloader“ComposerAutoloaderInit374429f4ab4935127e2d36a0613c8d3a”和“loadClassLoader

函数“loadClassLoader”存在,但我找不到“ComposerAutoloaderInit374429f4ab4935127e2d36a0613c8d3a”函数。

我的问题是:

There is "ComposerAutoloaderInit374429f4ab4935127e2d36a0613c8d3a" a autoloader function or the nameclass?

如果是自动装弹功能,class在什么地方?

提前致谢。

那其实只有一个autoloader,数组是回调

ComposerAutoloaderInit374429f4ab4935127e2d36a0613c8d3a是class的名称,loadClassLoader是其要使用的方法的名称。

class直接定义在autoload_real.php文件中,方法是class中的第一个方法。