Merge branch 'MDL-68735' of https://github.com/stronk7/moodle
authorSara Arjona <sara@moodle.com>
Mon, 1 Mar 2021 15:17:19 +0000 (16:17 +0100)
committerSara Arjona <sara@moodle.com>
Mon, 1 Mar 2021 15:17:19 +0000 (16:17 +0100)
admin/environment.xml
lang/en/admin.php
lib/environmentlib.php

index 857a8d3..3a71aef 100644 (file)
       <VENDOR name="oracle" version="11.2" />
     </DATABASE>
     <PHP version="7.1.0" level="required">
+      <RESTRICT function="restrict_php_version_80" message="unsupportedphpversion80" />
     </PHP>
     <PCREUNICODE level="optional">
       <FEEDBACK>
       <VENDOR name="oracle" version="11.2" />
     </DATABASE>
     <PHP version="7.2.0" level="required">
+      <RESTRICT function="restrict_php_version_80" message="unsupportedphpversion80" />
     </PHP>
     <PCREUNICODE level="optional">
       <FEEDBACK>
       <VENDOR name="oracle" version="11.2" />
     </DATABASE>
     <PHP version="7.2.0" level="required">
+      <RESTRICT function="restrict_php_version_80" message="unsupportedphpversion80" />
     </PHP>
     <PCREUNICODE level="optional">
       <FEEDBACK>
index 8a9cfe0..a766853 100644 (file)
@@ -1398,6 +1398,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';
index df11fa9..5068d85 100644 (file)
@@ -1653,3 +1653,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');
+}