From 8ead95fabe287732fd1ce669a09dfdf08cf70099 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 42090fc98d8..503eb448971 100644 --- a/lang/en/admin.php +++ b/lang/en/admin.php @@ -1201,6 +1201,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 3daebaebc64..9b172217325 100644 --- a/lib/environmentlib.php +++ b/lib/environmentlib.php @@ -1639,3 +1639,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'); +}