From 9a5d01b3fd1aa19e5da6987a01bc4dadc04499f3 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 7 Nov 2014 14:31:20 +0100 Subject: [PATCH] Check the mysql or pgsql extension instead of just pdo, really --- application/forms/Config/ResourceConfigForm.php | 2 +- application/forms/Setup/AuthenticationPage.php | 4 +--- application/forms/Setup/PreferencesPage.php | 4 +--- library/Icinga/Application/WebSetup.php | 8 ++++---- .../monitoring/application/forms/Setup/BackendPage.php | 7 +------ 5 files changed, 8 insertions(+), 17 deletions(-) diff --git a/application/forms/Config/ResourceConfigForm.php b/application/forms/Config/ResourceConfigForm.php index e4e561ed8..a269885cf 100644 --- a/application/forms/Config/ResourceConfigForm.php +++ b/application/forms/Config/ResourceConfigForm.php @@ -216,7 +216,7 @@ class ResourceConfigForm extends ConfigForm if ($resourceType === 'ldap' || Platform::extensionLoaded('ldap')) { $resourceTypes['ldap'] = 'LDAP'; } - if ($resourceType === 'db' || Platform::extensionLoaded('pdo')) { + if ($resourceType === 'db' || Platform::extensionLoaded('mysql') || Platform::extensionLoaded('pgsql')) { $resourceTypes['db'] = t('SQL Database'); } diff --git a/application/forms/Setup/AuthenticationPage.php b/application/forms/Setup/AuthenticationPage.php index 7ac565671..475203737 100644 --- a/application/forms/Setup/AuthenticationPage.php +++ b/application/forms/Setup/AuthenticationPage.php @@ -39,9 +39,7 @@ class AuthenticationPage extends Form ); $backendTypes = array(); - if (Platform::extensionLoaded('pdo') && (Platform::zendClassExists('Zend_Db_Adapter_Pdo_Mysql') - || Platform::zendClassExists('Zend_Db_Adapter_Pdo_Pgsql'))) - { + if (Platform::extensionLoaded('mysql') || Platform::extensionLoaded('pgsql')) { $backendTypes['db'] = t('Database'); } if (Platform::extensionLoaded('ldap')) { diff --git a/application/forms/Setup/PreferencesPage.php b/application/forms/Setup/PreferencesPage.php index 4e6a80cfb..25db67df0 100644 --- a/application/forms/Setup/PreferencesPage.php +++ b/application/forms/Setup/PreferencesPage.php @@ -52,9 +52,7 @@ class PreferencesPage extends Form $storageTypes = array(); $storageTypes['ini'] = t('File System (INI Files)'); - if (Platform::extensionLoaded('pdo') && (Platform::zendClassExists('Zend_Db_Adapter_Pdo_Mysql') - || Platform::zendClassExists('Zend_Db_Adapter_Pdo_Pgsql'))) - { + if (Platform::extensionLoaded('mysql') || Platform::extensionLoaded('pgsql')) { $storageTypes['db'] = t('Database'); } $storageTypes['null'] = t('Don\'t Store Preferences'); diff --git a/library/Icinga/Application/WebSetup.php b/library/Icinga/Application/WebSetup.php index a2fa80c35..5f873d8ab 100644 --- a/library/Icinga/Application/WebSetup.php +++ b/library/Icinga/Application/WebSetup.php @@ -473,8 +473,8 @@ class WebSetup extends Wizard implements SetupWizard $requirements->addOptional( t('PHP Module: PDO-MySQL'), t('Is Icinga Web 2 supposed to access a MySQL database the PDO-MySQL module for PHP is required.'), - Platform::extensionLoaded('pdo'), - Platform::extensionLoaded('pdo') ? t('The PHP module PDO-MySQL is available.') : ( + Platform::extensionLoaded('mysql'), + Platform::extensionLoaded('mysql') ? t('The PHP module PDO-MySQL is available.') : ( t('The PHP module PDO-MySQL is missing.') ) ); @@ -485,8 +485,8 @@ class WebSetup extends Wizard implements SetupWizard 'Is Icinga Web 2 supposed to access a PostgreSQL database' . ' the PDO-PostgreSQL module for PHP is required.' ), - Platform::extensionLoaded('pdo'), - Platform::extensionLoaded('pdo') ? t('The PHP module PDO-PostgreSQL is available.') : ( + Platform::extensionLoaded('pgsql'), + Platform::extensionLoaded('pgsql') ? t('The PHP module PDO-PostgreSQL is available.') : ( t('The PHP module PDO-PostgreSQL is missing.') ) ); diff --git a/modules/monitoring/application/forms/Setup/BackendPage.php b/modules/monitoring/application/forms/Setup/BackendPage.php index 95c5f9fe4..6cc5c1e39 100644 --- a/modules/monitoring/application/forms/Setup/BackendPage.php +++ b/modules/monitoring/application/forms/Setup/BackendPage.php @@ -40,12 +40,7 @@ class BackendPage extends Form ); $resourceTypes = array('livestatus' => 'Livestatus'); - if ( - Platform::extensionLoaded('pdo') && ( - Platform::zendClassExists('Zend_Db_Adapter_Pdo_Mysql') - || Platform::zendClassExists('Zend_Db_Adapter_Pdo_Pgsql') - ) - ) { + if (Platform::extensionLoaded('mysql') || Platform::extensionLoaded('pgsql')) { $resourceTypes['ido'] = 'IDO'; }