diff --git a/base.php b/base.php index 7a8ec541..8b5377c5 100644 --- a/base.php +++ b/base.php @@ -186,7 +186,7 @@ function S($name,$value='',$options=null) { return $cache->rm($name); }else { // 缓存数据 if(is_array($options)) { - $expire = is_numeric($options['expire'])?$options['expire']:NULL; //修复查询缓存无法设置过期时间 + $expire = isset($options['expire'])?$options['expire']:NULL; //修复查询缓存无法设置过期时间 }else{ $expire = is_numeric($options)?$options:NULL; //默认快捷缓存设置过期时间 } @@ -194,6 +194,16 @@ function S($name,$value='',$options=null) { } } +/** + * 日志记录 + * @param string $log 日志信息 + * @param string $type 日志类型 + * @return void + */ +function log($log,$type='DEBUG') { + Think\Log::record($log,$type); +} + /** * 字符串命名风格转换 * type 0 将Java风格转换为C的风格 1 将C风格转换为Java的风格