//这个函数似乎是5点几以后才支持的;之前的不支持;
spl_autoload_register(array('Kohana', 'auto_load'));
//然后kohana里可以写成类似的:
程序代码
final class Kohana {
public static function auto_load($class){
require $class . '.php';
}
}
这样,你new Abc(); 只要 Abc.php 这个文件存在,就会直接require进来;
看一眼应该能明白是什么意思吧!