From 8831cc14c72fc4153810f92299da308fbd99361e Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Fri, 13 Sep 2019 17:41:53 +0200 Subject: [PATCH] MDL-66262 env: Moodle 3.6.x and 3.7.x do not support PHP 7.4 --- admin/environment.xml | 2 ++ lang/en/admin.php | 1 + lib/environmentlib.php | 11 +++++++++++ 3 files changed, 14 insertions(+) diff --git a/admin/environment.xml b/admin/environment.xml index 78f6671ae1f..16b7402d357 100644 --- a/admin/environment.xml +++ b/admin/environment.xml @@ -2451,6 +2451,7 @@ + @@ -2632,6 +2633,7 @@ + diff --git a/lang/en/admin.php b/lang/en/admin.php index ba9e01ef297..f7d762ab930 100644 --- a/lang/en/admin.php +++ b/lang/en/admin.php @@ -1197,6 +1197,7 @@ $string['unsupportedphpversion7'] = 'PHP version 7 is not supported.'; $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['unsuspenduser'] = 'Activate user account'; $string['updateaccounts'] = 'Update existing accounts'; $string['updatecomponent'] = 'Update component'; diff --git a/lib/environmentlib.php b/lib/environmentlib.php index dbf2520b255..3daebaebc64 100644 --- a/lib/environmentlib.php +++ b/lib/environmentlib.php @@ -1628,3 +1628,14 @@ function restrict_php_version_72(&$result) { function restrict_php_version_73(&$result) { return restrict_php_version($result, '7.3'); } + +/** + * Check if the current PHP version is greater than or equal to + * PHP version 7.4. + * + * @param object $result an environment_results instance + * @return bool result of version check + */ +function restrict_php_version_74(&$result) { + return restrict_php_version($result, '7.4'); +}