mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-12 03:30:12 +08:00
Merge pull request #9496 from daliran/Sqlsrv-MARS
Fixed #9454: changed sqlsrv pdo class selection
This commit is contained in:
@@ -571,8 +571,12 @@ class Connection extends Component
|
|||||||
} elseif (($pos = strpos($this->dsn, ':')) !== false) {
|
} elseif (($pos = strpos($this->dsn, ':')) !== false) {
|
||||||
$driver = strtolower(substr($this->dsn, 0, $pos));
|
$driver = strtolower(substr($this->dsn, 0, $pos));
|
||||||
}
|
}
|
||||||
if (isset($driver) && ($driver === 'mssql' || $driver === 'dblib' || $driver === 'sqlsrv')) {
|
if (isset($driver)) {
|
||||||
|
if ($driver === 'mssql' || $driver === 'dblib') {
|
||||||
$pdoClass = 'yii\db\mssql\PDO';
|
$pdoClass = 'yii\db\mssql\PDO';
|
||||||
|
} else if ($driver === 'sqlsrv'){
|
||||||
|
$pdoClass = 'yii\db\mssql\SqlsrvPDO';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user