mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 10:38:45 +02:00
N°1728: Display error on setup for unsupported MySQL 8+ versions (MariaDB & Percona not affected)
This commit is contained in:
@@ -108,6 +108,10 @@ class MySQLHasGoneAwayException extends MySQLException
|
||||
*/
|
||||
class CMDBSource
|
||||
{
|
||||
const ENUM_DB_VENDOR_MYSQL = 'MySQL';
|
||||
const ENUM_DB_VENDOR_MARIADB = 'MariaDB';
|
||||
const ENUM_DB_VENDOR_PERCONA = 'Percona';
|
||||
|
||||
protected static $m_sDBHost;
|
||||
protected static $m_sDBUser;
|
||||
protected static $m_sDBPwd;
|
||||
@@ -406,6 +410,27 @@ class CMDBSource
|
||||
return $aVersions[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the DB vendor between MySQL and its main forks
|
||||
* @return string
|
||||
*/
|
||||
static public function GetDBVendor()
|
||||
{
|
||||
$sDBVendor = static::ENUM_DB_VENDOR_MYSQL;
|
||||
|
||||
$sVersionComment = strtolower(static::GetServerVariable('version_comment'));
|
||||
if(preg_match('/mariadb/', $sVersionComment) === 1)
|
||||
{
|
||||
$sDBVendor = static::ENUM_DB_VENDOR_MARIADB;
|
||||
}
|
||||
else if(preg_match('/percona/', $sVersionComment) === 1)
|
||||
{
|
||||
$sDBVendor = static::ENUM_DB_VENDOR_PERCONA;
|
||||
}
|
||||
|
||||
return $sDBVendor;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sSource
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user