Merge pull request #222 from shuipf/master

完善数据库驱动扩展
This commit is contained in:
ThinkPHP
2016-07-21 22:17:55 -05:00
committed by GitHub
2 changed files with 2 additions and 2 deletions

View File

@@ -284,7 +284,7 @@ abstract class Connection
if ($this->linkID) {
return $this->linkID->getAttribute(PDO::ATTR_DRIVER_NAME);
} else {
return basename(str_replace('\\', '/', $this->config['type']));
return $this->config['type'];
}
}

View File

@@ -359,7 +359,7 @@ class Query
static $builder = [];
$driver = $this->driver;
if (!isset($builder[$driver])) {
$class = '\\think\\db\\builder\\' . ucfirst($driver);
$class = false !== strpos($driver, '\\') ? $driver : '\\think\\db\\builder\\' . ucfirst($driver);
$builder[$driver] = new $class($this->connection);
}
// 设置当前查询对象