fix dbType bug

This commit is contained in:
Jerry 2023-06-07 13:08:26 +08:00 committed by Jerry Ma
parent c254aa51bf
commit 033088d06d
2 changed files with 3 additions and 3 deletions

View File

@ -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 运行时偏好(环境信息&参数)

View File

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