helloyou0 表示很无奈.get_included_files Gets the names of all files that have been included using include(), include_once(), require() or require_once().Returns an array of the names of all files.The script originally called is considered an "included file," so it will be listed together with the files referenced by include() and family.Files that are included or required multiple times only show up once in the returned array.
所以换用了另一种方法,把类或方法单独写在一个文件,然后再class_exists() ,function_exists() 检测
可以被动的include文件。可以参考下php5的magic函数:__autoload,在你的class里面实现这个方法,当此类被调用时这个方法就会触发,然后可以在这个方法中进行require_once $class_name . '.php';
楼主的问题,其实我们一般都是按照2楼的方法来解决的。class_exists() ,function_exists(),或是isset()都可以间接的判断某个类是否被include了。
再重复一遍: get_included_files虽然楼主可能只是要autoload或者include_once/require_once
Gets the names of all files that have been included using include(), include_once(), require() or require_once().Returns an array of the names of all files.The script originally called is considered an "included file," so it will be listed together with the files referenced by include() and family.Files that are included or required multiple times only show up once in the returned array.