mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-03-17 20:54:52 +08:00
fix dbType bug
This commit is contained in:
parent
c254aa51bf
commit
033088d06d
@ -50,7 +50,7 @@ class Framework
|
||||
public const VERSION_ID = 721;
|
||||
|
||||
/** @var string 版本名称 */
|
||||
public const VERSION = '3.2.0';
|
||||
public const VERSION = '3.2.1';
|
||||
|
||||
/**
|
||||
* @var RuntimePreferences 运行时偏好(环境信息&参数)
|
||||
|
||||
@ -22,12 +22,12 @@ class DBConnection implements Connection
|
||||
public function __construct(private array $params)
|
||||
{
|
||||
$this->db_type = $params['dbType'] ?? ZM_DB_POOL;
|
||||
if ($params['dbType'] === ZM_DB_POOL) {
|
||||
if ($this->db_type === ZM_DB_POOL) {
|
||||
// 默认连接池的形式,
|
||||
logger()->debug('Constructing...');
|
||||
$this->conn = DBPool::pool($params['dbName'])->get();
|
||||
$this->pool_name = $params['dbName'];
|
||||
} elseif ($params['dbType'] === ZM_DB_PORTABLE) {
|
||||
} elseif ($this->db_type === ZM_DB_PORTABLE) {
|
||||
$connect_str = 'sqlite:{filename}';
|
||||
if (FileSystem::isRelativePath($params['filename'])) {
|
||||
$params['filename'] = zm_dir(config('global.data_dir') . '/db/' . $params['filename']);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user