From dd7266745012155b3a89c0626f55b823ba426298 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Thu, 13 Mar 2025 10:54:01 +0800 Subject: [PATCH] MDL-80629 env: Moodle 4.4.x and 4.5.x do not support PHP 8.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 834b0177082..0d6f278cb42 100644 --- a/admin/environment.xml +++ b/admin/environment.xml @@ -4327,6 +4327,7 @@ + @@ -4522,6 +4523,7 @@ + diff --git a/lang/en/admin.php b/lang/en/admin.php index 025dbba2f58..b6c70e0e7a7 100644 --- a/lang/en/admin.php +++ b/lang/en/admin.php @@ -1509,6 +1509,7 @@ $string['unsupportedphpversion80'] = 'PHP version 8.0 and higher are not support $string['unsupportedphpversion81'] = 'PHP version 8.1 and higher are not supported.'; $string['unsupportedphpversion82'] = 'PHP version 8.2 and higher are not supported.'; $string['unsupportedphpversion83'] = 'PHP version 8.3 and higher are not supported.'; +$string['unsupportedphpversion84'] = 'PHP version 8.4 and higher are 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 4abbdd82fe4..7c8621248da 100644 --- a/lib/environmentlib.php +++ b/lib/environmentlib.php @@ -1699,3 +1699,14 @@ function restrict_php_version_82($result) { function restrict_php_version_83($result) { return restrict_php_version($result, '8.3'); } + +/** + * Check if the current PHP version is greater than or equal to + * PHP version 8.4 + * + * @param \environment_results $result an environment_results instance + * @return bool result of version check + */ +function restrict_php_version_84(environment_results $result) { + return restrict_php_version($result, '8.4'); +}