Skip to content

Commit

Permalink
Platform: Also check for the sqlsrv extension when checking MSSQL sup…
Browse files Browse the repository at this point in the history
…port

refs #3320
  • Loading branch information
nilmerg committed Apr 24, 2018
1 parent 24128e0 commit b14b61d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions library/Icinga/Application/Platform.php
Original file line number Diff line number Diff line change
Expand Up @@ -345,14 +345,20 @@ public static function hasDatabaseSupport()
/**
* 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');
}

/**
Expand Down

0 comments on commit b14b61d

Please sign in to comment.