mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Set PHP 7.2.5 as minimum supported version (#11470)
This commit is contained in:
@@ -31,6 +31,10 @@ use LibreNMS\Validator;
|
|||||||
|
|
||||||
class Php extends BaseValidation
|
class Php extends BaseValidation
|
||||||
{
|
{
|
||||||
|
const PHP_MIN_VERSION = '7.2.5';
|
||||||
|
const PHP_MIN_VERSION_DATE = 'May, 2020';
|
||||||
|
const PHP_RECOMMENDED_VERSION = '7.3';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validate this module.
|
* Validate this module.
|
||||||
* To return ValidationResults, call ok, warn, fail, or result methods on the $validator
|
* To return ValidationResults, call ok, warn, fail, or result methods on the $validator
|
||||||
@@ -48,11 +52,9 @@ class Php extends BaseValidation
|
|||||||
|
|
||||||
private function checkVersion(Validator$validator)
|
private function checkVersion(Validator$validator)
|
||||||
{
|
{
|
||||||
$min_version = '5.6.4';
|
|
||||||
|
|
||||||
// if update is not set to false and version is min or newer
|
// if update is not set to false and version is min or newer
|
||||||
if (Config::get('update') && version_compare(PHP_VERSION, $min_version, '<')) {
|
if (Config::get('update') && version_compare(PHP_VERSION, self::PHP_MIN_VERSION, '<')) {
|
||||||
$validator->warn('PHP version 5.6.4 is the minimum supported version as of January 10, 2018. We recommend you update to PHP a supported version of PHP (7.1 suggested) to continue to receive updates. If you do not update PHP, LibreNMS will continue to function but stop receiving bug fixes and updates.');
|
$validator->warn("PHP version " . self::PHP_MIN_VERSION . " is the minimum supported version as of " . self::PHP_MIN_VERSION_DATE . ". We recommend you update PHP to a supported version (" . self::PHP_RECOMMENDED_VERSION . " suggested) to continue to receive updates. If you do not update PHP, LibreNMS will continue to function but stop receiving bug fixes and updates.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ use LibreNMS\Util\Env;
|
|||||||
use LibreNMS\Util\Git;
|
use LibreNMS\Util\Git;
|
||||||
use LibreNMS\ValidationResult;
|
use LibreNMS\ValidationResult;
|
||||||
use LibreNMS\Validator;
|
use LibreNMS\Validator;
|
||||||
|
use LibreNMS\Validations\Php;
|
||||||
|
|
||||||
class Updates extends BaseValidation
|
class Updates extends BaseValidation
|
||||||
{
|
{
|
||||||
@@ -76,12 +77,12 @@ class Updates extends BaseValidation
|
|||||||
if ($versions['local_branch'] == 'php53') {
|
if ($versions['local_branch'] == 'php53') {
|
||||||
$validator->warn(
|
$validator->warn(
|
||||||
"You are on the PHP 5.3 support branch, this will prevent automatic updates.",
|
"You are on the PHP 5.3 support branch, this will prevent automatic updates.",
|
||||||
"Update to PHP 5.6.4 or newer (PHP 7.2 recommended) to continue to receive updates."
|
"Update to PHP 5.6.4 or newer (PHP " . Php::PHP_RECOMMENDED_VERSION . " recommended) to continue to receive updates."
|
||||||
);
|
);
|
||||||
} elseif ($versions['local_branch'] == 'php56') {
|
} elseif ($versions['local_branch'] == 'php56') {
|
||||||
$validator->warn(
|
$validator->warn(
|
||||||
"You are on the PHP 5.6/7.0 support branch, this will prevent automatic updates.",
|
"You are on the PHP 5.6/7.0 support branch, this will prevent automatic updates.",
|
||||||
"Update to PHP 7.1.3 or newer (PHP 7.2 recommended) to continue to receive updates."
|
"Update to PHP " . Php::PHP_MIN_VERSION . " or newer (PHP " . Php::PHP_RECOMMENDED_VERSION . " recommended) to continue to receive updates."
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$validator->warn(
|
$validator->warn(
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ use LibreNMS\Alert\AlertDB;
|
|||||||
use LibreNMS\Config;
|
use LibreNMS\Config;
|
||||||
use LibreNMS\Exceptions\LockException;
|
use LibreNMS\Exceptions\LockException;
|
||||||
use LibreNMS\Util\MemcacheLock;
|
use LibreNMS\Util\MemcacheLock;
|
||||||
|
use LibreNMS\Validations\Php;
|
||||||
|
|
||||||
$init_modules = array('alerts');
|
$init_modules = array('alerts');
|
||||||
require __DIR__ . '/includes/init.php';
|
require __DIR__ . '/includes/init.php';
|
||||||
@@ -180,13 +181,13 @@ if ($options['f'] === 'handle_notifiable') {
|
|||||||
$phpver = '5.6.4';
|
$phpver = '5.6.4';
|
||||||
$eol_date = 'January 10th, 2018';
|
$eol_date = 'January 10th, 2018';
|
||||||
} elseif ($options['r'] === 'php56') {
|
} elseif ($options['r'] === 'php56') {
|
||||||
$phpver = '7.1.3';
|
$phpver = Php::PHP_MIN_VERSION;
|
||||||
$eol_date = 'February 1st, 2019';
|
$eol_date = Php::PHP_MIN_VERSION_DATE;
|
||||||
}
|
}
|
||||||
if (isset($phpver)) {
|
if (isset($phpver)) {
|
||||||
new_notification(
|
new_notification(
|
||||||
$error_title,
|
$error_title,
|
||||||
"PHP version $phpver is the minimum supported version as of $eol_date. We recommend you update to PHP a supported version of PHP (7.2 suggested) to continue to receive updates. If you do not update PHP, LibreNMS will continue to function but stop receiving bug fixes and updates.",
|
"PHP version $phpver is the minimum supported version as of $eol_date. We recommend you update to PHP a supported version of PHP (" . Php::PHP_RECOMMENDED_VERSION . " suggested) to continue to receive updates. If you do not update PHP, LibreNMS will continue to function but stop receiving bug fixes and updates.",
|
||||||
2,
|
2,
|
||||||
'daily.sh'
|
'daily.sh'
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ path: blob/master/doc/
|
|||||||
> at `mysql>` prompts) or temporarily become a user with root
|
> at `mysql>` prompts) or temporarily become a user with root
|
||||||
> privileges with `sudo -s` or `sudo -i`.
|
> privileges with `sudo -s` or `sudo -i`.
|
||||||
|
|
||||||
**Please note the minimum supported PHP version is 7.1.3**
|
**Please note the minimum supported PHP version is 7.2.5**
|
||||||
|
|
||||||
|
|
||||||
## Install Common Required Packages ##
|
## Install Common Required Packages ##
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ path: blob/master/doc/
|
|||||||
> at `mysql>` prompts) or temporarily become a user with root
|
> at `mysql>` prompts) or temporarily become a user with root
|
||||||
> privileges with `sudo -s` or `sudo -i`.
|
> privileges with `sudo -s` or `sudo -i`.
|
||||||
|
|
||||||
**Please note the minimum supported PHP version is 7.1.3**
|
**Please note the minimum supported PHP version is 7.2.5**
|
||||||
|
|
||||||
# Install Required Packages
|
# Install Required Packages
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ path: blob/master/doc/
|
|||||||
> at `mysql>` prompts) or temporarily become a user with root
|
> at `mysql>` prompts) or temporarily become a user with root
|
||||||
> privileges with `sudo -s` or `sudo -i`.
|
> privileges with `sudo -s` or `sudo -i`.
|
||||||
|
|
||||||
**Please note the minimum supported PHP version is 7.1.3**
|
**Please note the minimum supported PHP version is 7.2.5**
|
||||||
|
|
||||||
# Install Required Packages
|
# Install Required Packages
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ path: blob/master/doc/
|
|||||||
> at `mysql>` prompts) or temporarily become a user with root
|
> at `mysql>` prompts) or temporarily become a user with root
|
||||||
> privileges with `sudo -s` or `sudo -i`.
|
> privileges with `sudo -s` or `sudo -i`.
|
||||||
|
|
||||||
**Please note the minimum supported PHP version is 7.1.3**
|
**Please note the minimum supported PHP version is 7.2.5**
|
||||||
|
|
||||||
# Install Required Packages
|
# Install Required Packages
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ We have some pre-built VirtualBox images you can use to get started:
|
|||||||
|
|
||||||
If you want to install manually then we have some documentation which should make it easy.
|
If you want to install manually then we have some documentation which should make it easy.
|
||||||
|
|
||||||
**Please note the minimum supported PHP version is 7.1.3**
|
**Please note the minimum supported PHP version is 7.2.5**
|
||||||
|
|
||||||
- [Ubuntu 18.04 Apache](http://docs.librenms.org/Installation/Installation-Ubuntu-1804-Apache/)
|
- [Ubuntu 18.04 Apache](http://docs.librenms.org/Installation/Installation-Ubuntu-1804-Apache/)
|
||||||
- [Ubuntu 18.04 Nginx](http://docs.librenms.org/Installation/Installation-Ubuntu-1804-Nginx/)
|
- [Ubuntu 18.04 Nginx](http://docs.librenms.org/Installation/Installation-Ubuntu-1804-Nginx/)
|
||||||
|
|||||||
Reference in New Issue
Block a user