Force autoloading of a class without having the na

2019-07-15 12:51发布

问题:

I'd like to have access to all classes that are in the context of my currently executing script. Unfortunately, the framework I am using is aggressive with its use of autoloading, and purposely defers loading of classes along the execution path.

How can I, without knowing the names of classes, force all classes that have a registered _autoload() function to either load, so that I can access them with get_declared_classes, or get their names?

回答1:

Well, if the autoload functions were added to spl_autoload_register() you should look at spl_autoload_functions().


Alternatively you could force the invocation of all registered autoloaders with spl_autoload_call().



标签: php oop