mirror of
https://github.com/monstra-cms/monstra.git
synced 2025-08-02 03:10:25 +02:00
Installer: use version_compare() function to compare php versions.
This commit is contained in:
14
install.php
14
install.php
@@ -15,14 +15,7 @@
|
|||||||
|
|
||||||
// Load bootstrap file
|
// Load bootstrap file
|
||||||
require_once(ROOT . DS . 'monstra' . DS . 'bootstrap.php');
|
require_once(ROOT . DS . 'monstra' . DS . 'bootstrap.php');
|
||||||
|
|
||||||
// Setting error display depending on debug mode or not
|
|
||||||
// Get php version id
|
|
||||||
if ( ! defined('PHP_VERSION_ID')){
|
|
||||||
$version = PHP_VERSION;
|
|
||||||
define('PHP_VERSION_ID', ($version{0} * 10000 + $version{2} * 100 + $version{4}));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get array with the names of all modules compiled and loaded
|
// Get array with the names of all modules compiled and loaded
|
||||||
$php_modules = get_loaded_extensions();
|
$php_modules = get_loaded_extensions();
|
||||||
|
|
||||||
@@ -182,7 +175,8 @@
|
|||||||
<body class="install-body">
|
<body class="install-body">
|
||||||
<!-- Block_wrapper -->
|
<!-- Block_wrapper -->
|
||||||
<?php
|
<?php
|
||||||
if (PHP_VERSION_ID < 50200) {
|
|
||||||
|
if (version_compare(PHP_VERSION, "5.2.0", "<")) {
|
||||||
$errors['php'] = 'error';
|
$errors['php'] = 'error';
|
||||||
} else {
|
} else {
|
||||||
$errors['php'] = '';
|
$errors['php'] = '';
|
||||||
@@ -372,7 +366,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if (PHP_VERSION_ID < 50200) {
|
if (version_compare(PHP_VERSION, "5.2.0", "<")) {
|
||||||
echo '<span class="error"><li>'.__('PHP 5.2 or greater is required', 'system').'</li></span>';
|
echo '<span class="error"><li>'.__('PHP 5.2 or greater is required', 'system').'</li></span>';
|
||||||
} else {
|
} else {
|
||||||
echo '<span class="ok"><li>'.__('PHP Version', 'system').' '.PHP_VERSION.'</li></span>';
|
echo '<span class="ok"><li>'.__('PHP Version', 'system').' '.PHP_VERSION.'</li></span>';
|
||||||
|
Reference in New Issue
Block a user