From 1305489f268bcc8e785219533224a6dcb4286f49 Mon Sep 17 00:00:00 2001 From: Wruczek Date: Fri, 1 Jul 2016 03:03:44 +0200 Subject: [PATCH] Added PHP version check --- include/modulecheck.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/include/modulecheck.php b/include/modulecheck.php index 1cbeda6..03f55e2 100644 --- a/include/modulecheck.php +++ b/include/modulecheck.php @@ -30,6 +30,23 @@ service apache2 reload } */ +function isPHPVersionSupported() { + if (!defined('PHP_VERSION_ID')) { + $version = explode('.', PHP_VERSION); + define('PHP_VERSION_ID', ($version[0] * 10000 + $version[1] * 100 + $version[2])); + } + + return PHP_VERSION_ID >= 50300; +} + +if (!isPHPVersionSupported()) { + $title = 'Niewspierana wersja PHP'; + + $text = '

Posiadasz starą, niewspieraną wersję PHP.

Twoja wersja PHP: ' . phpversion() . ', minimalna wymagana wersja PHP: 5.3.0.

Zaktualizuj PHP i spróbuj ponownie.

'; + + die(showError($title, $text)); +} + if(!file_exists(__DIR__ . "/../config/config.php")) { $title = 'Brak pliku config.php'; @@ -84,7 +101,7 @@ function showError($title, $text) { ?>