mirror of
https://github.com/netcccyun/dnsmgr.git
synced 2026-02-21 15:31:12 +08:00
26 lines
591 B
PHP
26 lines
591 B
PHP
<?php
|
|
declare (strict_types = 1);
|
|
|
|
namespace app\lib;
|
|
|
|
use think\db\ConnectionInterface;
|
|
|
|
class NewDbManager extends \think\Db
|
|
{
|
|
/**
|
|
* 创建数据库连接实例
|
|
* @access protected
|
|
* @param string|null $name 连接标识
|
|
* @param bool $force 强制重新连接
|
|
* @return ConnectionInterface
|
|
*/
|
|
protected function instance(string $name = null, bool $force = false): ConnectionInterface
|
|
{
|
|
if (empty($name)) {
|
|
$name = $this->getConfig('default', 'mysql');
|
|
}
|
|
|
|
return $this->createConnection($name);
|
|
}
|
|
}
|