From 8a3908b13eef94e677eced20560bc37f66bdefdc Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Sat, 13 Feb 2021 12:50:10 +0100 Subject: [PATCH] MDL-68735 env: Moodle 3.8.x, 3.9.x and 3.10.x do not support PHP 8.0 --- admin/environment.xml | 3 +++ lang/en/admin.php | 1 + lib/environmentlib.php | 11 +++++++++++ 3 files changed, 15 insertions(+) diff --git a/admin/environment.xml b/admin/environment.xml index 857a8d37ca9..3a71aef8e67 100644 --- a/admin/environment.xml +++ b/admin/environment.xml @@ -2815,6 +2815,7 @@ + @@ -2996,6 +2997,7 @@ + @@ -3177,6 +3179,7 @@ + diff --git a/lang/en/admin.php b/lang/en/admin.php index 38de4b769bc..693602fd7ec 100644 --- a/lang/en/admin.php +++ b/lang/en/admin.php @@ -1329,6 +1329,7 @@ $string['unsupportedphpversion71'] = 'PHP version 7.1 is not supported.'; $string['unsupportedphpversion72'] = 'PHP version 7.2 is not supported.'; $string['unsupportedphpversion73'] = 'PHP version 7.3 is not supported.'; $string['unsupportedphpversion74'] = 'PHP version 7.4 is not supported.'; +$string['unsupportedphpversion80'] = 'PHP version 8.0 is not supported.'; $string['unsuspenduser'] = 'Activate user account'; $string['updateaccounts'] = 'Update existing accounts'; $string['updatecomponent'] = 'Update component'; diff --git a/lib/environmentlib.php b/lib/environmentlib.php index 64a3a4ffed9..f1894db94b6 100644 --- a/lib/environmentlib.php +++ b/lib/environmentlib.php @@ -1646,3 +1646,14 @@ function restrict_php_version_73(&$result) { function restrict_php_version_74(&$result) { return restrict_php_version($result, '7.4'); } + +/** + * Check if the current PHP version is greater than or equal to + * PHP version 8.0 + * + * @param object $result an environment_results instance + * @return bool result of version check + */ +function restrict_php_version_80($result) { + return restrict_php_version($result, '8.0'); +}