diff --git a/api.php b/api.php index bccd0ccada3..67d06fb5403 100644 --- a/api.php +++ b/api.php @@ -19,8 +19,9 @@ * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -if (version_compare(phpversion(), '7.3.0', '<') === true) { - echo 'It looks like you have an invalid PHP version. OpenMage supports PHP 7.3.0 or newer'; +$minVersion = '7.3.0'; +if (version_compare(phpversion(), $minVersion, '<') === true) { + echo "It looks like you have an invalid PHP version. OpenMage supports PHP $minVersion or newer"; exit; } diff --git a/get.php b/get.php index 5a8c332be16..01e4c165a57 100644 --- a/get.php +++ b/get.php @@ -18,15 +18,14 @@ * @copyright Copyright (c) 2016-2022 The OpenMage Contributors (https://www.openmage.org) * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -if (version_compare(phpversion(), '7.3.0', '<') === true) { - echo '

Whoops, it looks like you have an invalid PHP version.' - . '

OpenMage supports PHP 7.3.0 or newer. Find out how to install OpenMage using PHP-CGI as a work-around.

'; +$minVersion = '7.3.0'; +if (version_compare(phpversion(), $minVersion, '<') === true) { + echo "

Whoops, it looks like you have an invalid PHP version.

"; + echo "

OpenMage supports PHP $minVersion or newer. Find out how to install OpenMage using PHP-CGI as a work-around.

"; exit; } + $start = microtime(true); /** * Error reporting diff --git a/index.php b/index.php index 033338ba1ab..7fe01f56f90 100644 --- a/index.php +++ b/index.php @@ -19,13 +19,10 @@ * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -if (version_compare(phpversion(), '7.3.0', '<') === true) { - echo '
-
-

-Whoops, it looks like you have an invalid PHP version.

OpenMage supports PHP 7.3.0 or newer. -Find out how to install - OpenMage using PHP-CGI as a work-around.

'; +$minVersion = '7.3.0'; +if (version_compare(phpversion(), $minVersion, '<') === true) { + echo "

Whoops, it looks like you have an invalid PHP version.

"; + echo "

OpenMage supports PHP $minVersion or newer. Find out how to install OpenMage using PHP-CGI as a work-around.

"; exit; } diff --git a/install.php b/install.php index 4cccd8b8c60..f7d99e8467a 100644 --- a/install.php +++ b/install.php @@ -113,9 +113,13 @@ * */ -if (version_compare(phpversion(), '7.3.0', '<') === true) { - die('ERROR: Whoops, it looks like you have an invalid PHP version. OpenMage supports PHP 7.3.0 or newer.'); +$minVersion = '7.3.0'; +if (version_compare(phpversion(), $minVersion, '<') === true) { + echo "

Whoops, it looks like you have an invalid PHP version.

"; + echo "

OpenMage supports PHP $minVersion or newer. Find out how to install OpenMage using PHP-CGI as a work-around.

"; + exit; } + set_include_path(__DIR__ . PATH_SEPARATOR . get_include_path()); require 'app/bootstrap.php'; require 'app/Mage.php';