N°2214 Blocks execution for PHP < 7.0.0

As older PHP version can cause multiple problems, and we still use lots of requires that can generate PARSE_ERROR on such version, we chose to add this very low-level control. Therefore user will get a clear error message, and oldest PHP version will be blocked in the whole application.
This commit is contained in:
Pierre Goiffon
2020-09-22 15:35:13 +02:00
parent 98789f28bb
commit 9e9b192b3c

View File

@@ -1,7 +1,7 @@
<?php
/**
* Copyright (C) 2013-2019 Combodo SARL
* Copyright (C) 2013-2020 Combodo SARL
*
* This file is part of iTop.
*
@@ -18,16 +18,31 @@
* You should have received a copy of the GNU Affero General Public License
*/
/**
* Checks PHP version
*
* This is a hard-coded check that limits errors : we are stopping for anything < PHP 7.0.0
* The "real one" will be done in {@link \SetupUtils::CheckPhpVersion()}
*
* @since 2.8.0 N°2214
*/
$bIsValidPhpVersion = false;
if (PHP_MAJOR_VERSION >= 7) {
$bIsValidPhpVersion = true;
} else {
echo 'Your PHP version ('.PHP_VERSION.') isn\'t supported.';
exit(-1);
}
define('ITOP_DEFAULT_ENV', 'production');
define('MAINTENANCE_MODE_FILE', APPROOT.'data/.maintenance');
define('READONLY_MODE_FILE', APPROOT.'data/.readonly');
if (function_exists('microtime'))
{
if (function_exists('microtime')) {
$fItopStarted = microtime(true);
}
else
{
} else {
$fItopStarted = 1000 * time();
}