Name: moodle-local_confseed
Owner: Liip
Description: Moodle 'local' plugin to seed configuration to DB at installation or upgrade time
Created: 2018-04-30 08:04:17.0
Updated: 2018-04-30 09:44:58.0
Pushed: 2018-04-30 13:09:52.0
Homepage: null
Size: 43
Language: PHP
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This plugin allows the automated setup of various configurations that are usually hard to setup through config.php
.
It uses a special file config-seed.php
containing only the $CONFSEED
configuration variable, which is a stdClass
in which attributes can be set to be enforced at upgrade time:
version
This will be used as the local/confseed
plugin version. Only changes to that field will trigger new configuration enforcements.settings
is an array
whose keys are the $CFG->
settings that need to be set to the provided valuesuser_info_categories
is an array
of stdClass
$DB
descriptors for the {user_info_category}
database table, which keys are codename for the below user_info_fields
.id
name
user_info_fields
is an array
of stdClass
$DB
descriptors for the {user_info_field}
database table, which keys are the table shortname
s. Please refer to user/profile/field/*/define.class.php
for the various attributes' usages.name
datatype
auth_enable
is an array
of authentication plugins (without auth/
nor auth_
prefixes) that need to be forcibly enabledauth_disable
is an array
of authentication plugins (without auth/
nor auth_
prefixes) that need to be forcibly disabledenrol_enable
is an array
of enrolment plugins (without enrol/
nor enrolq_
prefixes) that need to be forcibly enabledenrol_disable
is an array
of enrolment plugins (without enrol/
nor enrol_
prefixes) that need to be forcibly disableduninstall_plugins
is an array
of full plugin names (such as theme_oldmamma
) to be uninstalled. If set, all pre-2.7 themes are also uninstalledconfig-seed.php
exampleFSEED = new stdClass();
FSEED->version = 2017110800;
et some values.
FSEED->settings = array(
heme' => 'boost',
nablewebservices' => 1,
et some plugin values (like 'moodlecourse | format')
FSEED->plugin_settings = array(
oodlecourse' => array (
'format' => 'weeks'
ninstall certain plugins; all the pre-2.7 themes are uninstalled forcibly if the variable is set.
FSEED->uninstall_plugins = array(
'theme_oldmamma',
reate user profile categories.
FSEED->user_info_categories = array(
ood' => (object) array(
'id' => 1,
'name' => 'Alimentary restrictions',
'sortorder' => 1,
reate user profile fields.
FSEED->user_info_fields = array(
eat' => (object) array(
'category' => 'food',
'name' => 'I eat meat',
'required' => false,
'signup' => true,
'datatype' => 'checkbox',
'defaultdata' => false
reetext' => (object) array(
'category' => 'food',
'name' => 'Comments ?',
'signup' => true,
'datatype' => 'text',
'param1' => 60, // Display size.
'param2' => 512, // Maximum length.
nable or disable certain authentications.
FSEED->auth_enable = ['cas', ];
FSEED->auth_disable = ['email', ];
nable or disable certain enrolment methods.
FSEED->enrol_enable = ['database', ];
FSEED->enrol_disable = ['self', ];
how or hide certain activity modules.
FSEED->mod_show = ['assignment', ];
FSEED->mod_hide = ['book', ];
nable or disable certain webservices protocols.
FSEED->wsprotocols_enable = ['rest', ];
FSEED->wsprotocols_disable = ['soap', ];
Due to Moodle Core forcibly setting the registerauth
setting upon install, it is not possible for local_confseed
to seed this variable upon install. It does work upon upgrade though.