Skip to content

Commit

Permalink
MDL-76406 core: Add environment check for versions not supporting 8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
safatshahin committed Jun 2, 2023
1 parent abb8647 commit c2e0c4a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions admin/environment.xml
Expand Up @@ -3751,6 +3751,7 @@
<VENDOR name="oracle" version="19" />
</DATABASE>
<PHP version="7.4.0" level="required">
<RESTRICT function="restrict_php_version_82" message="unsupportedphpversion82" />
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
Expand Down
1 change: 1 addition & 0 deletions lang/en/admin.php
Expand Up @@ -1435,6 +1435,7 @@
$string['unsupportedphpversion74'] = 'PHP version 7.4 and higher are not supported.';
$string['unsupportedphpversion80'] = 'PHP version 8.0 and higher are not supported.';
$string['unsupportedphpversion81'] = 'PHP version 8.1 and higher are not supported.';
$string['unsupportedphpversion82'] = 'PHP version 8.2 and higher are not supported.';
$string['unsuspenduser'] = 'Activate user account';
$string['updateaccounts'] = 'Update existing accounts';
$string['updatecomponent'] = 'Update component';
Expand Down
11 changes: 11 additions & 0 deletions lib/environmentlib.php
Expand Up @@ -1675,3 +1675,14 @@ function restrict_php_version_80($result) {
function restrict_php_version_81($result) {
return restrict_php_version($result, '8.1');
}

/**
* Check if the current PHP version is greater than or equal to
* PHP version 8.2
*
* @param object $result an environment_results instance
* @return bool result of version check
*/
function restrict_php_version_82($result) {
return restrict_php_version($result, '8.2');
}

0 comments on commit c2e0c4a

Please sign in to comment.