From 8b367e08349d582b218175b30fe28c2f0a6d0044 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20Schro=CC=88der?= Date: Mon, 28 Jul 2014 14:55:13 +0200 Subject: [PATCH] moved min php version constant into system util class --- application/ManiaControl.php | 3 --- application/core/Utils/SystemUtil.php | 13 +++++++------ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/application/ManiaControl.php b/application/ManiaControl.php index b53f8cf9..a52e90a7 100644 --- a/application/ManiaControl.php +++ b/application/ManiaControl.php @@ -11,9 +11,6 @@ define('LOG_NAME_USE_PID', true); // Use current process id as suffix for log fi // Define base dir define('ManiaControlDir', __DIR__ . DIRECTORY_SEPARATOR); -// Min PHP Version -define('MIN_PHP_VERSION', '5.4'); - // Set process settings ini_set('memory_limit', '64M'); if (!ini_get('date.timezone') && function_exists('date_default_timezone_set')) { diff --git a/application/core/Utils/SystemUtil.php b/application/core/Utils/SystemUtil.php index ec1d5a1b..2169938f 100644 --- a/application/core/Utils/SystemUtil.php +++ b/application/core/Utils/SystemUtil.php @@ -15,8 +15,9 @@ class SystemUtil { /* * Constants */ - const OS_UNIX = 'Unix'; - const OS_WIN = 'Windows'; + const OS_UNIX = 'Unix'; + const OS_WIN = 'Windows'; + const MIN_PHP_VERSION = '5.4'; /** * Get whether ManiaControl is running on Windows @@ -76,13 +77,13 @@ class SystemUtil { // Check for min PHP version $phpVersion = phpversion(); - $message = 'Checking for minimum required PHP-Version ' . MIN_PHP_VERSION . ' ... '; - if ($phpVersion < MIN_PHP_VERSION) { + $message = 'Checking for minimum required PHP-Version ' . self::MIN_PHP_VERSION . ' ... '; + if ($phpVersion < self::MIN_PHP_VERSION) { Logger::log($message . $phpVersion . ' TOO OLD VERSION!'); - Logger::log(' -- Make sure that you install at least PHP ' . MIN_PHP_VERSION . '!'); + Logger::log(' -- Make sure that you install at least PHP ' . self::MIN_PHP_VERSION . '!'); $success = false; } else { - Logger::log($message . MIN_PHP_VERSION . ' OK!'); + Logger::log($message . self::MIN_PHP_VERSION . ' OK!'); } // Check for MySQLi