|
|
@ -253,7 +253,10 @@ class Connection extends Component |
|
|
|
* @var Schema the database schema |
|
|
|
* @var Schema the database schema |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private $_schema; |
|
|
|
private $_schema; |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* @var string Custom PDO wrapper class. If not set, it will use "PDO" or "yii\db\mssql\PDO" when MSSQL is used. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public $pdoClass; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns a value indicating whether the DB connection is established. |
|
|
|
* Returns a value indicating whether the DB connection is established. |
|
|
@ -338,6 +341,8 @@ class Connection extends Component |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
protected function createPdoInstance() |
|
|
|
protected function createPdoInstance() |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
$pdoClass = $this->pdoClass; |
|
|
|
|
|
|
|
if ($pdoClass === null) { |
|
|
|
$pdoClass = 'PDO'; |
|
|
|
$pdoClass = 'PDO'; |
|
|
|
if (($pos = strpos($this->dsn, ':')) !== false) { |
|
|
|
if (($pos = strpos($this->dsn, ':')) !== false) { |
|
|
|
$driver = strtolower(substr($this->dsn, 0, $pos)); |
|
|
|
$driver = strtolower(substr($this->dsn, 0, $pos)); |
|
|
@ -345,6 +350,8 @@ class Connection extends Component |
|
|
|
$pdoClass = 'yii\db\mssql\PDO'; |
|
|
|
$pdoClass = 'yii\db\mssql\PDO'; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return new $pdoClass($this->dsn, $this->username, $this->password, $this->attributes); |
|
|
|
return new $pdoClass($this->dsn, $this->username, $this->password, $this->attributes); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|