From 57435b527d3e452739eb9c6b3f03e7dc21644441 Mon Sep 17 00:00:00 2001 From: "jesse.li" Date: Thu, 5 Jul 2018 13:49:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=85=B3=E9=97=AD=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E8=BF=9E=E6=8E=A5=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Core/Db.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Core/Db.php b/src/Core/Db.php index 6934198..2117005 100644 --- a/src/Core/Db.php +++ b/src/Core/Db.php @@ -406,4 +406,14 @@ public function quote($string, $type = \PDO::PARAM_STR) return $this->getConnect()->quote($string, $type); } + /** + * 关闭数据连接 + */ + public function close() + { + foreach ($this->connections as $key => $conn) { + $this->connections[$key] = null; + unset($this->connections[$key]); + } + } }