From 786d9cd3a1c129f577e3b19aecaf5adf0c6cd7c3 Mon Sep 17 00:00:00 2001 From: Marina Glancy Date: Mon, 23 Oct 2017 14:16:57 +0800 Subject: [PATCH] MDL-60543 env: Moodle 3.2 and 3.3 do no support PHP7.2 --- 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 b8c7f1600e5..1f2f001564c 100644 --- a/admin/environment.xml +++ b/admin/environment.xml @@ -1754,6 +1754,7 @@ + @@ -1919,6 +1920,7 @@ + diff --git a/lang/en/admin.php b/lang/en/admin.php index 2449b314589..6f9d4ea3691 100644 --- a/lang/en/admin.php +++ b/lang/en/admin.php @@ -1176,6 +1176,7 @@ $string['unsupporteddbstorageengine'] = 'The database storage engine being used $string['unsupporteddbtablerowformat'] = 'Your database has tables using Antelope as the file format. You are recommended to convert the tables to the Barracuda file format. See the documentation Administration via command line for details of a tool for converting InnoDB tables to Barracuda.'; $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['unsuspenduser'] = 'Activate user account'; $string['updateaccounts'] = 'Update existing accounts'; $string['updatecomponent'] = 'Update component'; diff --git a/lib/environmentlib.php b/lib/environmentlib.php index f83e69de92f..270d79c54dc 100644 --- a/lib/environmentlib.php +++ b/lib/environmentlib.php @@ -1593,3 +1593,14 @@ function restrict_php_version(&$result, $version) { function restrict_php_version_71(&$result) { return restrict_php_version($result, '7.1'); } + +/** + * Check if the current PHP version is greater than or equal to + * PHP version 7.2. + * + * @param object $result an environment_results instance + * @return bool result of version check + */ +function restrict_php_version_72(&$result) { + return restrict_php_version($result, '7.2'); +}