moved min php version constant into system util class

This commit is contained in:
Steffen Schröder 2014-07-28 14:55:13 +02:00
parent cc21807ed1
commit 8b367e0834
2 changed files with 7 additions and 9 deletions

View File

@ -11,9 +11,6 @@ define('LOG_NAME_USE_PID', true); // Use current process id as suffix for log fi
// Define base dir // Define base dir
define('ManiaControlDir', __DIR__ . DIRECTORY_SEPARATOR); define('ManiaControlDir', __DIR__ . DIRECTORY_SEPARATOR);
// Min PHP Version
define('MIN_PHP_VERSION', '5.4');
// Set process settings // Set process settings
ini_set('memory_limit', '64M'); ini_set('memory_limit', '64M');
if (!ini_get('date.timezone') && function_exists('date_default_timezone_set')) { if (!ini_get('date.timezone') && function_exists('date_default_timezone_set')) {

View File

@ -15,8 +15,9 @@ class SystemUtil {
/* /*
* Constants * Constants
*/ */
const OS_UNIX = 'Unix'; const OS_UNIX = 'Unix';
const OS_WIN = 'Windows'; const OS_WIN = 'Windows';
const MIN_PHP_VERSION = '5.4';
/** /**
* Get whether ManiaControl is running on Windows * Get whether ManiaControl is running on Windows
@ -76,13 +77,13 @@ class SystemUtil {
// Check for min PHP version // Check for min PHP version
$phpVersion = phpversion(); $phpVersion = phpversion();
$message = 'Checking for minimum required PHP-Version ' . MIN_PHP_VERSION . ' ... '; $message = 'Checking for minimum required PHP-Version ' . self::MIN_PHP_VERSION . ' ... ';
if ($phpVersion < MIN_PHP_VERSION) { if ($phpVersion < self::MIN_PHP_VERSION) {
Logger::log($message . $phpVersion . ' TOO OLD 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; $success = false;
} else { } else {
Logger::log($message . MIN_PHP_VERSION . ' OK!'); Logger::log($message . self::MIN_PHP_VERSION . ' OK!');
} }
// Check for MySQLi // Check for MySQLi