Moodle Sandbox and Developer Tips & Tricks
Site blog
Anyone in the world
For install scripts, it can be useful to add some specific settings for plugins.
There are a couple of options
Plugin settings via the command line
The cfg.php script allows settings to be set from the command line. Note that these can be overidden by a site admin in the front end
eg: to enable clamav and set the path
php admin/cli/cfg.php --name=antiviruses --set=clamav
php admin/cli/cfg.php --component=antivirus_clamav --name=pathtoclam
--set="/usr/bin/clamscan"
Plugin settings via config.php
$CFG->antiviruses = 'clamav';
$CFG->forced_plugin_settings = ['antivirus_clamav' =>
['pathtoclam' => '/usr/bin/clamscan']];
[ Modified: Tuesday, 5 August 2025, 12:35 PM ]