config_support
class config_support
| internal |
Configuration utility wrapper for Moodle's config API.
This class centralizes access to get_config/set_config/unset_config for the plugin, providing a safe façade that catches exceptions and returns predictable values.
Constants
| PLUGIN_NAME |
|
Methods
Retrieves a configuration value for this plugin.
Retrieves configuration for any component or a single named key.
Sets a configuration value for a specific plugin or component.
Unsets (removes) a configuration value.
Retrieves a value from the global Moodle configuration $CFG.
Retrieves the SITEID constant value.
Details
at line 45
static mixed
get(string|null $name = null)
Retrieves a configuration value for this plugin.
at line 68
static mixed
get_config(string $plugin, string|null $name = null)
Retrieves configuration for any component or a single named key.
at line 88
static bool
set_config(string $name, mixed $value, string $plugin = self::PLUGIN_NAME)
Sets a configuration value for a specific plugin or component.
at line 107
static bool
unset_config(string $name, string $plugin = self::PLUGIN_NAME)
Unsets (removes) a configuration value.
at line 125
static mixed
get_global(string $name)
Retrieves a value from the global Moodle configuration $CFG.
at line 137
static stdClass
get_site()
Retrieves the site object ($SITE global).
at line 149
static int
get_site_id()
Retrieves the SITEID constant value.