mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°1728: Display error on setup for unsupported MySQL 8+ versions (MariaDB & Percona not affected)
This commit is contained in:
@@ -52,6 +52,8 @@ class SetupUtils
|
||||
// -- Minimum versions (requirements : forbids installation if not met)
|
||||
const PHP_MIN_VERSION = '5.6.0'; // 5.6 will be supported until the end of 2018 (see http://php.net/supported-versions.php)
|
||||
const MYSQL_MIN_VERSION = '5.6.0'; // 5.6 to have fulltext on InnoDB for Tags fields (N°931)
|
||||
const MYSQL_NOT_VALIDATED_VERSION = '8.0.0'; //Mysql 8 not validated as of iTop 2.6
|
||||
|
||||
// -- versions that will be the minimum in next iTop major release (warning if not met)
|
||||
const PHP_NEXT_MIN_VERSION = ''; // no new PHP requirement for next iTop version
|
||||
const MYSQL_NEXT_MIN_VERSION = ''; // no new MySQL requirement for next iTop version
|
||||
@@ -1215,10 +1217,19 @@ EOF
|
||||
*
|
||||
* @return boolean false if DB doesn't meet the minimum version requirement
|
||||
*/
|
||||
private static function CheckDbServerVersion(&$aResult, $oDBSource)
|
||||
static private function CheckDbServerVersion(&$aResult, $oDBSource)
|
||||
{
|
||||
$sDBVendor= $oDBSource->GetDBVendor();
|
||||
$sDBVersion = $oDBSource->GetDBVersion();
|
||||
if (version_compare($sDBVersion, self::MYSQL_MIN_VERSION, '>='))
|
||||
$bRet = false;
|
||||
|
||||
if (version_compare($sDBVersion, self::MYSQL_NOT_VALIDATED_VERSION, '>=') && ($sDBVendor === CMDBSource::ENUM_DB_VENDOR_MYSQL))
|
||||
{
|
||||
$aResult['checks'][] = new CheckResult(CheckResult::ERROR,
|
||||
"Error: Current MySQL version is $sDBVersion. iTop doesn't yet support MySQL ".self::MYSQL_NOT_VALIDATED_VERSION." and above.");
|
||||
$bRet = false;
|
||||
}
|
||||
else if (version_compare($sDBVersion, self::MYSQL_MIN_VERSION, '>='))
|
||||
{
|
||||
$aResult['checks'][] = new CheckResult(CheckResult::INFO,
|
||||
"Current MySQL version ($sDBVersion), greater than minimum required version (".self::MYSQL_MIN_VERSION.")");
|
||||
@@ -1238,13 +1249,16 @@ EOF
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
$bRet = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$aResult['checks'][] = new CheckResult(CheckResult::ERROR,
|
||||
"Error: Current MySQL version is $sDBVersion, minimum required version is ".self::MYSQL_MIN_VERSION);
|
||||
$bRet = false;
|
||||
}
|
||||
|
||||
$aResult['checks'][] = new CheckResult(CheckResult::ERROR,
|
||||
"Error: Current MySQL version is $sDBVersion, minimum required version is ".self::MYSQL_MIN_VERSION);
|
||||
|
||||
return false;
|
||||
return $bRet;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user