内核更新
This commit is contained in:
@@ -226,13 +226,17 @@ abstract class Connection
|
||||
/**
|
||||
* 设置数据库的配置参数
|
||||
* @access public
|
||||
* @param string $config 配置名称
|
||||
* @param mixed $value 配置值
|
||||
* @param string|array $config 配置名称
|
||||
* @param mixed $value 配置值
|
||||
* @return void
|
||||
*/
|
||||
public function setConfig($config, $value)
|
||||
public function setConfig($config, $value = '')
|
||||
{
|
||||
$this->config[$config] = $value;
|
||||
if (is_array($config)) {
|
||||
$this->config = array_merge($this->config, $config);
|
||||
} else {
|
||||
$this->config[$config] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -247,7 +251,7 @@ abstract class Connection
|
||||
public function connect(array $config = [], $linkNum = 0, $autoConnection = false)
|
||||
{
|
||||
if (!isset($this->links[$linkNum])) {
|
||||
if (empty($config)) {
|
||||
if (!$config) {
|
||||
$config = $this->config;
|
||||
}
|
||||
// 连接参数
|
||||
@@ -281,20 +285,6 @@ abstract class Connection
|
||||
return $this->links[$linkNum];
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前数据库的驱动类型
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getDriverName()
|
||||
{
|
||||
if ($this->linkID) {
|
||||
return $this->linkID->getAttribute(PDO::ATTR_DRIVER_NAME);
|
||||
} else {
|
||||
return $this->config['type'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 释放查询结果
|
||||
* @access public
|
||||
|
||||
Reference in New Issue
Block a user