From 85b90ec8822254076e95bc0c8342f914a02aaf71 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Tue, 2 Apr 2013 17:52:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0log=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E7=94=A8=E4=BA=8E=E8=AE=B0=E5=BD=95=E6=97=A5=E5=BF=97=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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的风格