This commit is contained in:
thinkphp
2015-12-11 08:32:17 +08:00
parent 01cc676a7a
commit ea9041b858
2 changed files with 10 additions and 12 deletions

View File

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