From d918c1e763092af1d2ec20e175c447dc5a75cf02 Mon Sep 17 00:00:00 2001 From: Luca Date: Mon, 7 Feb 2022 13:36:31 +0100 Subject: [PATCH] Avviso requisito minimo php 7.4 --- core.php | 2 +- include/init/requirements.php | 26 +++++++++++++++++++++++--- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/core.php b/core.php index c22580eda..cced4a696 100755 --- a/core.php +++ b/core.php @@ -24,7 +24,7 @@ header_remove('X-Powered-By'); date_default_timezone_set('Europe/Rome'); // Controllo sulla versione PHP -$minimum = '7.1.0'; +$minimum = '7.2.0'; if (version_compare(phpversion(), $minimum) < 0) { echo '

Stai utilizzando la versione PHP '.phpversion().', non compatibile con OpenSTAManager.

diff --git a/include/init/requirements.php b/include/init/requirements.php index 43a22cf30..665c4964a 100755 --- a/include/init/requirements.php +++ b/include/init/requirements.php @@ -43,8 +43,16 @@ foreach ($modules as $name => $values) { ]; } -// PHP +//PHP $settings = [ + + 'php_version' => [ + 'type' => 'php', + 'description' => '7.4 - 8.0', + 'minimum' => '7.4', + 'maximum' => '8.0', + ], + 'zip' => [ 'type' => 'ext', 'description' => tr('Permette di leggere e scrivere gli archivi compressi ZIP e i file al loro interno'), @@ -98,13 +106,23 @@ $settings = [ 'type' => 'value', 'description' => '>32M', ], + ]; $php = []; foreach ($settings as $name => $values) { $description = $values['description']; - if ($values['type'] == 'ext') { + if ($values['type'] == 'php') { + + $description = tr('Valore consigliato: _VALUE_ (Valore attuale: _PHP_VERSION_)', [ + '_VALUE_' => $description, + '_PHP_VERSION_' => phpversion(), + ]); + + $status = (version_compare(phpversion(), $values['minimum']) < 0 || (version_compare(phpversion(), $values['maximum']) > 0) ? 0 : 1); + + } elseif ($values['type'] == 'ext') { $status = extension_loaded($name); } else { $ini = str_replace(['k', 'M'], ['000', '000000'], ini_get($name)); @@ -161,12 +179,14 @@ foreach ($dirs as $name => $description) { $requirements = [ tr('Apache') => $apache, - tr('PHP (_VERSION_)', [ + tr('PHP (_VERSION_ _SUPPORTED_)', [ '_VERSION_' => phpversion(), + '_SUPPORTED_' => (version_compare(phpversion(), $settings['php_version']['minimum']) < 0 || (version_compare(phpversion(), $settings['php_version']['maximum']) > 0) ? ' '.tr('versioni supportate:').' '.$settings['php_version']['minimum'].' - '.$settings['php_version']['maximum'].'' : '' ) ]) => $php, tr('Percorsi di servizio') => $directories, ]; + // Tabelle di riepilogo foreach ($requirements as $key => $values) { $statuses = array_column($values, 'status');