mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-23 05:44:36 +02:00
DbConnection: Automatically choose sqlsrv as driver..
..if available and none is explicitly set. refs #3320
This commit is contained in:
parent
c566c8bfde
commit
24128e0cc3
@ -139,14 +139,23 @@ class DbConnection implements Selectable, Extensible, Updatable, Reducible, Insp
|
|||||||
switch ($this->dbType) {
|
switch ($this->dbType) {
|
||||||
case 'mssql':
|
case 'mssql':
|
||||||
$adapter = 'Pdo_Mssql';
|
$adapter = 'Pdo_Mssql';
|
||||||
$pdoType = $this->config->get('pdoType', 'dblib');
|
$pdoType = $this->config->get('pdoType');
|
||||||
|
if (empty($pdoType)) {
|
||||||
|
if (extension_loaded('sqlsrv')) {
|
||||||
|
$adapter = 'Sqlsrv';
|
||||||
|
} else {
|
||||||
|
$pdoType = 'dblib';
|
||||||
|
}
|
||||||
|
}
|
||||||
if ($pdoType === 'dblib') {
|
if ($pdoType === 'dblib') {
|
||||||
// Driver does not support setting attributes
|
// Driver does not support setting attributes
|
||||||
unset($adapterParamaters['persistent']);
|
unset($adapterParamaters['persistent']);
|
||||||
unset($adapterParamaters['options']);
|
unset($adapterParamaters['options']);
|
||||||
unset($adapterParamaters['driver_options']);
|
unset($adapterParamaters['driver_options']);
|
||||||
}
|
}
|
||||||
$adapterParamaters['pdoType'] = $pdoType;
|
if (! empty($pdoType)) {
|
||||||
|
$adapterParamaters['pdoType'] = $pdoType;
|
||||||
|
}
|
||||||
$defaultPort = 1433;
|
$defaultPort = 1433;
|
||||||
break;
|
break;
|
||||||
case 'mysql':
|
case 'mysql':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user