From b14b61d37a1c960ce8bc06b78db6b11da7de4e3a Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 24 Apr 2018 15:56:29 +0200 Subject: [PATCH] Platform: Also check for the sqlsrv extension when checking MSSQL support refs #3320 --- library/Icinga/Application/Platform.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/library/Icinga/Application/Platform.php b/library/Icinga/Application/Platform.php index 2bfb3863a..e05251801 100644 --- a/library/Icinga/Application/Platform.php +++ b/library/Icinga/Application/Platform.php @@ -345,14 +345,20 @@ class Platform /** * Return whether it's possible to connect to a MSSQL database * - * Checks whether the mssql pdo extension has been loaded and Zend framework adapter for MSSQL is available + * Checks whether the mssql/dblib pdo or sqlsrv extension has + * been loaded and Zend framework adapter for MSSQL is available * * @return bool */ public static function hasMssqlSupport() { - return (static::extensionLoaded('mssql') || static::extensionLoaded('pdo_dblib')) - && static::classExists('Zend_Db_Adapter_Pdo_Mssql'); + if ((static::extensionLoaded('mssql') || static::extensionLoaded('pdo_dblib')) + && static::classExists('Zend_Db_Adapter_Pdo_Mssql') + ) { + return true; + } + + return static::extensionLoaded('sqlsrv') && static::classExists('Zend_Db_Adapter_Sqlsrv'); } /**