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]; }