From 8d731b2f4c68a3d310934982240402c48edb384a Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 12 Jul 2017 10:27:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BDb=E7=B1=BB=E7=9A=84=E5=BC=BA?= =?UTF-8?q?=E5=88=B6=E9=87=8D=E8=BF=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Db.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/library/think/Db.php b/library/think/Db.php index e239fd4e..8fa799eb 100644 --- a/library/think/Db.php +++ b/library/think/Db.php @@ -82,10 +82,9 @@ class Db Log::record('[ DB ] INIT ' . $options['type'], 'info'); } if (true === $name) { - return new $class($options); - } else { - self::$instance[$name] = new $class($options); + $name = md5(serialize($config)); } + self::$instance[$name] = new $class($options); } return self::$instance[$name]; }