+ -
当前位置:首页 → 问答吧 → 自动加载类库问题?

自动加载类库问题?

时间:2011-05-04

来源:互联网

惯例配置中APP_AUTOLOAD_RGE为false,APP::init中
      if(C('APP_AUTOLOAD_REG') && function_exists('spl_autoload_register'))
            spl_autoload_register(array('Think', 'autoload'));
为何又能自动加载think/util中的类库???

作者: dymlr   发布时间: 2011-05-04

ThinkPHP/Common/function.php 中定义了 __autoload 函数。  如果 APP_AUTOLOAD_REG 为flase 只是自动加载则是这个函数, 如果true 自动加载的函数是  Think::autoload

作者: luofei614   发布时间: 2011-05-04