Forced settings
插件管理工具稳定版

Forced settings

tool_forced_settingsJordi Pujol Ahulló

  • Moodle 4.5–5.1
  • 更新 2026-02-03

A Moodle admin tool plugin that sets up forced settings from external text files.
Settings Overrider for Moodle
A Moodle admin tool plugin that allows overriding configuration settings from external files.
Features
JSON format support : Built-in clean and readable configuration files
Extensible architecture : Easy to add new configuration formats
Automatic format detection : Based on file extension
Custom loaders : Use custom loaders without modifying plugin code
Safe loading : Error handling for production environments
CLI validation tool : Validate JSON configuration files
Pre-setup execution : Runs before Moodle setup, using only native PHP functions
Quick Start
Basic Usage (JSON files)
Add the following to your   config.php   before   require_once(__DIR__ . ‘/lib/setup.php’); :
// Override settings from configuration file.
require_once ( __DIR__ . ‘/admin/tool/overrider/classes/local/settings_overrider.php’ );
tool_overrider local settings_overrider:: settings_from ( $ CFG , __DIR__ . ‘/.moodle_settings.json’ );
Note : The   settings_from()   method directly modifies the provided   $CFG   object with the configuration from the file. It does not return any value.
Configuration File Format
{

返回插件目录