Force autoloading of a class without having the na

2019-07-15 12:16发布

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?

标签: php oop
1条回答
不美不萌又怎样
2楼-- · 2019-07-15 12:44

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().

查看更多
登录 后发表回答