From e2f0c4d193a0ebe5765435eb606c891dbfeccca9 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 8 Dec 2015 03:57:56 -0500 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dslog=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/org/slog.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/org/slog.php b/library/org/slog.php index 3a22f71d..69283e84 100644 --- a/library/org/slog.php +++ b/library/org/slog.php @@ -39,6 +39,7 @@ class Slog public static function sql($sql, $pdo) { + if (is_object($pdo)) { if (!self::check()) { return; @@ -58,9 +59,10 @@ class Slog } self::sqlwhere($sql, $css); self::trace($sql, 2, $css); + }else{ + throw new Exception('SocketLog can not support this database link'); } - throw new Exception('SocketLog can not support this database link'); } public static function trace($msg, $trace_level = 2, $css = '')