if(C('SHOW_DB_TIMES') && class_exists('Db',false) ) {
// 显示数据库操作次数
$showTime .= ' | DB :'.N('db_query').' queries '.N('db_write').' writes ';
}
if(C('SHOW_CACHE_TIMES') && class_exists('Cache',false)) {
// 显示缓存读写次数
$showTime .= ' | Cache :'.N('cache_read').' gets '.N('cache_write').' writes ';
}
其中的 class_exists('Cache',false) ,这句没有作用 ,改为 class_exists('\Think\\Cache',false) 后是正常的 。命名空间真麻烦 ,建议将框架的这地方都查一下。
最佳答案
