From 9c802cf1d4410f2f12c3f9812beb2338ee6aee8b Mon Sep 17 00:00:00 2001 From: Simey Lameze Date: Tue, 4 Oct 2016 12:06:10 +0800 Subject: [PATCH] MDL-55121 environment: check for unsuported php version 7.1 --- 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 032b8d7a8d5..f8c560b4a1c 100644 --- a/admin/environment.xml +++ b/admin/environment.xml @@ -1444,6 +1444,7 @@ + @@ -1587,6 +1588,7 @@ + diff --git a/lang/en/admin.php b/lang/en/admin.php index 002631f7b4b..81781b40a8b 100644 --- a/lang/en/admin.php +++ b/lang/en/admin.php @@ -1075,6 +1075,7 @@ $string['unsupported'] = 'Unsupported'; $string['unsupporteddbstorageengine'] = 'The database storage engine being used is no longer supported.'; $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['unsuspenduser'] = 'Activate user account'; $string['updateaccounts'] = 'Update existing accounts'; $string['updatecomponent'] = 'Update component'; diff --git a/lib/environmentlib.php b/lib/environmentlib.php index 481ed5352d6..e066dc62f00 100644 --- a/lib/environmentlib.php +++ b/lib/environmentlib.php @@ -1579,3 +1579,14 @@ function restrict_php_version(&$result, $version) { return true; } } + +/** + * Check if the current PHP version is greater than or equal to + * PHP version 7.1. + * + * @param object $result an environment_results instance + * @return bool result of version check + */ +function restrict_php_version_71(&$result) { + return restrict_php_version($result, '7.1'); +}