mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-09-02 21:41:36 +08:00
改进
This commit is contained in:
@@ -17,9 +17,9 @@ namespace think;
|
||||
class Db
|
||||
{
|
||||
// 数据库连接实例
|
||||
private static $instance = [];
|
||||
private static $instance = [];
|
||||
// 当前数据库连接实例
|
||||
private static $_instance = null;
|
||||
private static $_instance = null;
|
||||
|
||||
/**
|
||||
* 取得数据库类实例
|
||||
@@ -36,7 +36,7 @@ class Db
|
||||
// 解析连接参数 支持数组和字符串
|
||||
$options = self::parseConfig($config);
|
||||
// 如果采用lite方式 仅支持原生SQL 包括query和execute方法
|
||||
$class = $lite ? 'think\\db\\lite' : 'think\\db\\driver\\' . strtolower($options['type']);
|
||||
$class = $lite ? '\\think\\db\\Lite' : '\\think\\db\\driver\\' . ucwords($options['type']);
|
||||
self::$instance[$md5] = new $class($options);
|
||||
}
|
||||
self::$_instance = self::$instance[$md5];
|
||||
|
||||
Reference in New Issue
Block a user