它的Is there an easy way to get the file where a class was instantiated in PHP?类似问题,但方法不同。
我需要知道自动加载(__autoload()或spl_autoload())函数的来源,以便我可以加载正确的子命名空间类
让我们通过一个例子说明我的问题 - 请考虑以下课程: /my/project/root/faculties/faculty.class.php [namespace:faculties] /my/project/root/faculties/faculty1/faculty.class.php [namespace:faculties / faculty1] /my/project/root/faculties/completely/different/project/at/deep/project/root/faculties/faculty.class.php [namespace:faculties]
现在,如果我想访问该不同项目的实例,它与root项目的冲突会导致其相同的命名空间。