From f84998cae77271b97ef40ee1dee1c920945a4ffb Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 7 Sep 2016 10:53:06 +0800 Subject: [PATCH] =?UTF-8?q?Loader=E7=B1=BBdb=E6=96=B9=E6=B3=95=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0name=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Loader.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/library/think/Loader.php b/library/think/Loader.php index 9451db66..90780d04 100644 --- a/library/think/Loader.php +++ b/library/think/Loader.php @@ -452,13 +452,14 @@ class Loader } /** - * 实例化数据库 - * @param mixed $config 数据库配置 - * @return object + * 数据库初始化 并取得数据库类实例 + * @param mixed $config 数据库配置 + * @param bool|string $name 连接标识 true 强制重新连接 + * @return \think\db\Connection */ - public static function db($config = []) + public static function db($config = [], $name = false) { - return Db::connect($config); + return Db::connect($config, $name); } /**