From a68fcabc656abbf52c257159ab01e1db41dd08cb Mon Sep 17 00:00:00 2001 From: Huong Nguyen Date: Thu, 13 Jun 2024 15:39:41 +0700 Subject: [PATCH] MDL-79809 environment: Add missing Moodle 4.4 requirements --- admin/environment.xml | 2 ++ lang/en/admin.php | 3 +++ lib/upgradelib.php | 18 ++++++++++++++++++ 3 files changed, 23 insertions(+) diff --git a/admin/environment.xml b/admin/environment.xml index e031c7fc270..20fdcd27ad9 100644 --- a/admin/environment.xml +++ b/admin/environment.xml @@ -4504,6 +4504,8 @@ + + diff --git a/lang/en/admin.php b/lang/en/admin.php index 2d7f848043b..2c01b09659d 100644 --- a/lang/en/admin.php +++ b/lang/en/admin.php @@ -73,6 +73,9 @@ $string['alternativefullnameformat_desc'] = 'This defines how names are shown to $string['always'] = 'Always'; $string['appearance'] = 'Appearance'; $string['aspellpath'] = 'Path to aspell'; +$string['asyncbackupdisabled'] = 'Your site is currently configured to use synchronous backups. Asynchronous backups provide a better user experience. +Asynchronous backups will be enabled for all sites from Moodle LMS 4.5 LTS. +Synchronous backups will be removed from Moodle LMS the version after 4.5 LTS'; $string['authentication'] = 'Authentication'; $string['authpreventaccountcreation'] = 'Prevent account creation when authenticating'; $string['authpreventaccountcreation_help'] = 'When a user authenticates, an account on the site is automatically created if it doesn\'t yet exist. If an external database, such as LDAP, is used for authentication, but you wish to restrict access to the site to users with an existing account only, then this option should be enabled. New accounts will need to be created manually or via the upload users feature. Note that this setting doesn\'t apply to MNet authentication.'; diff --git a/lib/upgradelib.php b/lib/upgradelib.php index d53bfb82fe8..55323c75b59 100644 --- a/lib/upgradelib.php +++ b/lib/upgradelib.php @@ -2858,3 +2858,21 @@ function check_oracle_usage(environment_results $result): ?environment_results { return null; } + +/** + * Check if asynchronous backups are enabled. + * + * @param environment_results $result + * @return environment_results|null + */ +function check_async_backup(environment_results $result): ?environment_results { + global $CFG; + + if (!during_initial_install() && empty($CFG->enableasyncbackup)) { // Have to use $CFG as config table may not be available. + $result->setInfo('Asynchronous backups disabled'); + $result->setFeedbackStr('asyncbackupdisabled'); + return $result; + } + + return null; +}