mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-05 22:52:49 +08:00
驱动设计支持使用 namespace配置改变默认命名空间位置
This commit is contained in:
@@ -40,7 +40,7 @@ class Db
|
||||
// 解析连接参数 支持数组和字符串
|
||||
$options = self::parseConfig($config);
|
||||
// 如果采用lite方式 仅支持原生SQL 包括query和execute方法
|
||||
$class = $lite ? '\\think\\db\\Lite' : '\\think\\db\\driver\\' . ucwords($options['type']);
|
||||
$class = $lite ? '\\think\\db\\Lite' : (!empty($options['namespace']) ? $options['namespace'] : '\\think\\db\\driver\\') . ucwords($options['type']);
|
||||
self::$instances[$md5] = new $class($options);
|
||||
}
|
||||
self::$instance = self::$instances[$md5];
|
||||
|
||||
Reference in New Issue
Block a user