From b952f9da4ac14c1790c80cdc928bb00576796e69 Mon Sep 17 00:00:00 2001 From: Pierre Goiffon Date: Thu, 22 Feb 2018 14:28:52 +0000 Subject: [PATCH] =?UTF-8?q?N=C2=B0942=20allow=20to=20have=20no=20new=20PHP?= =?UTF-8?q?/MySQL=20requirements=20for=20next=20release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SVN:trunk[5363] --- setup/setuputils.class.inc.php | 46 +++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/setup/setuputils.class.inc.php b/setup/setuputils.class.inc.php index cf9b3005b..75934f9d4 100644 --- a/setup/setuputils.class.inc.php +++ b/setup/setuputils.class.inc.php @@ -50,11 +50,11 @@ class CheckResult class SetupUtils { // -- Minimum versions (requirements : forbids installation if not met) - const PHP_MIN_VERSION = '5.6.0'; - const MYSQL_MIN_VERSION = '5.5.3'; + const PHP_MIN_VERSION = '5.6.0'; // 5.6 will be supported since the end of 2018 (see http://php.net/supported-versions.php) + const MYSQL_MIN_VERSION = '5.5.3'; // 5.5 branch that is shipped with most distribution, and 5.5.3 to have utf8mb4 (see N°942) // -- versions that will be the minimum in next iTop major release (warning if not met) - const PHP_NEXT_MIN_VERSION = '5.6.0'; // 5.6 will be supported since the end of 2018 (see http://php.net/supported-versions.php) - const MYSQL_NEXT_MIN_VERSION = '5.5.3'; // 5.5 branch that is shipped with most distribution, and 5.5.3 to have utf8mb4 (see N°942) + const PHP_NEXT_MIN_VERSION = ''; // no new PHP requirement for now in iTop 2.6 + const MYSQL_NEXT_MIN_VERSION = ''; // no new MySQL requirement for now in iTop 2.6 // -- First recent version that is not yet validated by Combodo (warning) const PHP_NOT_VALIDATED_VERSION = '7.2.0'; @@ -352,15 +352,18 @@ class SetupUtils "The current PHP Version (".$sPhpVersion.") is greater than the minimum version required to run ".ITOP_APPLICATION.", which is (".self::PHP_MIN_VERSION.")"); - if (version_compare($sPhpVersion, self::PHP_NEXT_MIN_VERSION, '>=')) + if (!empty(self::PHP_NEXT_MIN_VERSION)) { - $aResult[] = new CheckResult(CheckResult::INFO, - "The current PHP Version (".$sPhpVersion.") is greater than the minimum version required to run next ".ITOP_APPLICATION." release, which is (".self::PHP_NEXT_MIN_VERSION.")"); - } - else - { - $aResult[] = new CheckResult(CheckResult::WARNING, - "The current PHP Version (".$sPhpVersion.") is lower than the minimum version required to run next ".ITOP_APPLICATION." release, which is (".self::PHP_NEXT_MIN_VERSION.")"); + if (version_compare($sPhpVersion, self::PHP_NEXT_MIN_VERSION, '>=')) + { + $aResult[] = new CheckResult(CheckResult::INFO, + "The current PHP Version (".$sPhpVersion.") is greater than the minimum version required to run next ".ITOP_APPLICATION." release, which is (".self::PHP_NEXT_MIN_VERSION.")"); + } + else + { + $aResult[] = new CheckResult(CheckResult::WARNING, + "The current PHP Version (".$sPhpVersion.") is lower than the minimum version required to run next ".ITOP_APPLICATION." release, which is (".self::PHP_NEXT_MIN_VERSION.")"); + } } if (version_compare($sPhpVersion, self::PHP_NOT_VALIDATED_VERSION, '>=')) @@ -1244,15 +1247,18 @@ EOF $aResult['checks'][] = new CheckResult(CheckResult::INFO, "Current MySQL version ($sDBVersion), greater than minimum required version (".self::MYSQL_MIN_VERSION.")"); - if (version_compare($sDBVersion, self::MYSQL_NEXT_MIN_VERSION, '>=')) + if (!empty(self::MYSQL_NEXT_MIN_VERSION)) { - $aResult['checks'][] = new CheckResult(CheckResult::INFO, - "Current MySQL version ($sDBVersion), greater than minimum required version for next ".ITOP_APPLICATION." release (".self::MYSQL_NEXT_MIN_VERSION.")"); - } - else - { - $aResult['checks'][] = new CheckResult(CheckResult::WARNING, - "Warning : Current MySQL version is $sDBVersion, minimum required version for next ".ITOP_APPLICATION." release will be ".self::MYSQL_NEXT_MIN_VERSION); + if (version_compare($sDBVersion, self::MYSQL_NEXT_MIN_VERSION, '>=')) + { + $aResult['checks'][] = new CheckResult(CheckResult::INFO, + "Current MySQL version ($sDBVersion), greater than minimum required version for next ".ITOP_APPLICATION." release (".self::MYSQL_NEXT_MIN_VERSION.")"); + } + else + { + $aResult['checks'][] = new CheckResult(CheckResult::WARNING, + "Warning : Current MySQL version is $sDBVersion, minimum required version for next ".ITOP_APPLICATION." release will be ".self::MYSQL_NEXT_MIN_VERSION); + } } return true;