diff --git a/installwizard.php b/installwizard.php index d9dfecc23..a05d6fb6e 100755 --- a/installwizard.php +++ b/installwizard.php @@ -2,28 +2,29 @@ include_once('constants.php'); include_once('config.php'); - /* Version check before we include this. */ - $phpVersion = phpversion(); - $phpVersionParts = explode('.', $phpVersion); - if ($phpVersionParts[0] >= 5) + $minimumPHPVersion = '8.4.1'; + $isSupportedPHPVersion = version_compare( + PHP_VERSION, + $minimumPHPVersion, + '>=' + ); + + if ($isSupportedPHPVersion) { include_once(LEGACY_ROOT . '/lib/Template.php'); include_once(LEGACY_ROOT . '/lib/Session.php'); include_once(LEGACY_ROOT . '/lib/TemplateUtility.php'); - @session_name(CATS_SESSION_NAME); + session_name(CATS_SESSION_NAME); session_start(); } - else - { - $php4 = true; - } + $installLibURL = 'js/lib.js'; $installScriptURL = 'js/install.js'; $subModalScriptURL = 'js/submodal/subModal.js'; $installCSSURL = 'modules/install/install.css'; - if (!isset($php4)) + if ($isSupportedPHPVersion) { $installLibURL = call_user_func(array('TemplateUtility', 'getVersionedAssetURL'), $installLibURL); $installScriptURL = call_user_func(array('TemplateUtility', 'getVersionedAssetURL'), $installScriptURL); @@ -37,7 +38,7 @@ OpenCATS - Installation Wizard Script isLoggedIn()) + if ($isSupportedPHPVersion && isset($_SESSION['CATS']) && $_SESSION['CATS']->isLoggedIn()) { echo '', "\n"; @@ -122,7 +123,14 @@
Test Results - + + +
PHP 5.0.0 or greater is required to run OpenCATS. Found version: .
+ OpenCATS requires PHP + + or newer. Found PHP + . +
-
-

Your PHP version is OpenCATS Requires PHP 5 or better.

-

Please get a newer version of PHP and try again.

+
+

+ Your PHP version is + . + OpenCATS requires PHP + + or newer. +

+

Please install a supported PHP version and try again.