mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-09-25 18:59:04 +02:00
Add database resource type IBM for DB2
It uses the pdo_ibm driver and Zend Adapter Zend_Db_Adapter_Pdo_Ibm. Signed-off-by: Markus Frosch <markus.frosch@icinga.com>
This commit is contained in:
parent
8d2e22a738
commit
39838f1606
@ -36,6 +36,9 @@ class DbResourceForm extends Form
|
|||||||
if (Platform::hasMssqlSupport()) {
|
if (Platform::hasMssqlSupport()) {
|
||||||
$dbChoices['mssql'] = 'MSSQL';
|
$dbChoices['mssql'] = 'MSSQL';
|
||||||
}
|
}
|
||||||
|
if (Platform::hasIbmSupport()) {
|
||||||
|
$dbChoices['ibm'] = 'IBM (DB2)';
|
||||||
|
}
|
||||||
if (Platform::hasOracleSupport()) {
|
if (Platform::hasOracleSupport()) {
|
||||||
$dbChoices['oracle'] = 'Oracle';
|
$dbChoices['oracle'] = 'Oracle';
|
||||||
}
|
}
|
||||||
@ -45,6 +48,7 @@ class DbResourceForm extends Form
|
|||||||
|
|
||||||
$offerSsl = false;
|
$offerSsl = false;
|
||||||
$offerPostgres = false;
|
$offerPostgres = false;
|
||||||
|
$offerIbm = false;
|
||||||
$offerMysql = false;
|
$offerMysql = false;
|
||||||
$dbChoice = isset($formData['db']) ? $formData['db'] : key($dbChoices);
|
$dbChoice = isset($formData['db']) ? $formData['db'] : key($dbChoices);
|
||||||
if ($dbChoice === 'pgsql') {
|
if ($dbChoice === 'pgsql') {
|
||||||
@ -54,6 +58,8 @@ class DbResourceForm extends Form
|
|||||||
if (version_compare(Platform::getPhpVersion(), '5.4.0', '>=')) {
|
if (version_compare(Platform::getPhpVersion(), '5.4.0', '>=')) {
|
||||||
$offerSsl = true;
|
$offerSsl = true;
|
||||||
}
|
}
|
||||||
|
} elseif ($dbChoice === 'ibm') {
|
||||||
|
$offerIbm = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$socketInfo = '';
|
$socketInfo = '';
|
||||||
|
@ -366,6 +366,18 @@ class Platform
|
|||||||
return static::extensionLoaded('pdo_mysql') && static::classExists('Zend_Db_Adapter_Pdo_Mysql');
|
return static::extensionLoaded('pdo_mysql') && static::classExists('Zend_Db_Adapter_Pdo_Mysql');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return whether it's possible to connect to a IBM DB2 database
|
||||||
|
*
|
||||||
|
* Checks whether the ibm pdo extension has been loaded and the Zend framework adapter for IBM is available
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public static function hasIbmSupport()
|
||||||
|
{
|
||||||
|
return static::extensionLoaded('pdo_ibm') && static::classExists('Zend_Db_Adapter_Pdo_Ibm');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return whether it's possible to connect to a Oracle database using OCI8
|
* Return whether it's possible to connect to a Oracle database using OCI8
|
||||||
*
|
*
|
||||||
|
@ -203,6 +203,10 @@ class DbConnection implements Selectable, Extensible, Updatable, Reducible, Insp
|
|||||||
$adapter = 'Pdo_Pgsql';
|
$adapter = 'Pdo_Pgsql';
|
||||||
$defaultPort = 5432;
|
$defaultPort = 5432;
|
||||||
break;
|
break;
|
||||||
|
case 'ibm':
|
||||||
|
$adapter = 'Pdo_Ibm';
|
||||||
|
$defaultPort = 50000;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
throw new ConfigurationError(
|
throw new ConfigurationError(
|
||||||
'Backend "%s" is not supported',
|
'Backend "%s" is not supported',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user