MDL-73145 install: Apply site preset if defined in config

A new setting, $CFG->setsitepresetduringinstall, has been added to
config file, to let admins define the site admin preset to be applied
during the Moodle installation.

Besides, a new parameter, "--sitepreset" has been also added
to admin/cli/install.php, to let define it too when running the
upgrade process using CLI.
This commit is contained in:
Sara Arjona 2021-11-17 16:56:48 +01:00
parent 5ee0b620ae
commit 42895003e4
6 changed files with 198 additions and 0 deletions

View file

@ -1152,6 +1152,22 @@ $CFG->admin = 'admin';
// When the full classname is used, this rule always takes priority over any wildcard rules.
//
//=========================================================================
// 18. SITE ADMIN PRESETS
//=========================================================================
//
// The site admin presets plugin has been integrated in Moodle LMS. You can use a setting in case you
// want to apply a preset during the installation:
//
// $CFG->setsitepresetduringinstall = 'starter';
//
// This setting accepts the following values:
// - One of the core preset names (i.e "starter" or "full").
// - The path of a valid XML preset file, that will be imported and applied. Absolute paths are recommended, to
// guarantee the file is found: i.e."MOODLEPATH/admin/tool/admin_presets/tests/fixtures/import_settings_plugins.xml".
//
// This setting is only used during the installation process. So once the Moodle site is installed, it is ignored.
//
//=========================================================================
// ALL DONE! To continue installation, visit your main page with a browser
//=========================================================================