改名
This commit is contained in:
+3
-38
@@ -40,18 +40,6 @@ class Connection extends Component
|
||||
|
||||
public $maxNumber = 100;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*
|
||||
* @example [
|
||||
* ['cds' => 'mysql:dbname=dbname;host=127.0.0.1', 'username' => 'root', 'password' => 'root'],
|
||||
* ['cds' => 'mysql:dbname=dbname;host=127.0.0.1', 'username' => 'root', 'password' => 'root'],
|
||||
* ['cds' => 'mysql:dbname=dbname;host=127.0.0.1', 'username' => 'root', 'password' => 'root'],
|
||||
* ['cds' => 'mysql:dbname=dbname;host=127.0.0.1', 'username' => 'root', 'password' => 'root'],
|
||||
* ]
|
||||
*/
|
||||
public $masterConfig = [];
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
* enable database cache
|
||||
@@ -63,10 +51,9 @@ class Connection extends Component
|
||||
* @var array
|
||||
*
|
||||
* @example [
|
||||
* ['cds' => 'mysql:dbname=dbname;host=127.0.0.1', 'username' => 'root', 'password' => 'root'],
|
||||
* ['cds' => 'mysql:dbname=dbname;host=127.0.0.1', 'username' => 'root', 'password' => 'root'],
|
||||
* ['cds' => 'mysql:dbname=dbname;host=127.0.0.1', 'username' => 'root', 'password' => 'root'],
|
||||
* ['cds' => 'mysql:dbname=dbname;host=127.0.0.1', 'username' => 'root', 'password' => 'root'],
|
||||
* 'cds' => 'mysql:dbname=dbname;host=127.0.0.1',
|
||||
* 'username' => 'root',
|
||||
* 'password' => 'root'
|
||||
* ]
|
||||
*/
|
||||
public $slaveConfig = [];
|
||||
@@ -186,28 +173,6 @@ class Connection extends Component
|
||||
return $pool->getConnection($config, true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $name
|
||||
* @return Connection
|
||||
* @throws ConfigException
|
||||
*/
|
||||
public function instance($name)
|
||||
{
|
||||
$config = Config::get('databases.' . $name, true);
|
||||
|
||||
$this->cds = $config['cds'];
|
||||
$this->username = $config['username'];
|
||||
$this->password = $config['password'];
|
||||
|
||||
$this->tablePrefix = $config['tablePrefix'];
|
||||
|
||||
$this->slaveConfig = $config['slaveConfig'];
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return PDO
|
||||
* @throws Exception
|
||||
|
||||
Reference in New Issue
Block a user