From 31bf125994468b9e7f4da3200af236707871f606 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Tue, 8 Dec 2015 13:13:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/org/slog.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/library/org/slog.php b/library/org/slog.php index 309091b2..07cc5f25 100644 --- a/library/org/slog.php +++ b/library/org/slog.php @@ -37,9 +37,9 @@ class Slog 'big' => 'font-size:20px;color:red;', ]; - public static function sql($sql, $link) + public static function sql($sql, $pdo) { - if (is_object($link)) { + if (is_object($pdo)) { if (!self::check()) { return; } @@ -187,18 +187,18 @@ class Slog protected static function check() { - if (!self::getConfig('enable')) { + if (!self::$config['enable']) { return false; } $tabid = self::getClientArg('tabid'); //是否记录日志的检查 - if (!$tabid && !self::getConfig('force_client_id')) { + if (!$tabid && !self::$config['force_client_id']) { return false; } //用户认证 - $allow_client_ids = self::getConfig('allow_client_ids'); + $allow_client_ids = self::$config['allow_client_ids']; if (!empty($allow_client_ids)) { - if (!$tabid && in_array(self::getConfig('force_client_id'), $allow_client_ids)) { + if (!$tabid && in_array(self::$config['force_client_id'], $allow_client_ids)) { return true; } @@ -326,7 +326,7 @@ class Slog 'css' => self::$css['page'], ]); - if (self::getConfig('show_included_files')) { + if (self::$config['show_included_files']) { self::$logs[] = [ 'type' => 'groupCollapsed', 'msg' => 'included_files', @@ -354,7 +354,7 @@ class Slog if (!$client_id = self::getClientArg('client_id')) { $client_id = ''; } - if ($force_client_id = self::getConfig('force_client_id')) { + if ($force_client_id = self::$config['force_client_id']) { $client_id = $force_client_id; } $logs = [ @@ -365,7 +365,7 @@ class Slog ]; $msg = @json_encode($logs); $address = '/' . $client_id; //将client_id作为地址, server端通过地址判断将日志发布给谁 - self::send(self::getConfig('host'), $msg, $address); + self::send(self::$config['host'], $msg, $address); }