改进Db类的强制重连

This commit is contained in:
thinkphp
2017-07-12 10:27:48 +08:00
parent 8e61503111
commit 8d731b2f4c

View File

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