MDL-79011 core: Convert after_config callback to hook

This commit is contained in:
Andrew Nicols
2024-08-22 10:52:25 +08:00
parent e0a9cf2288
commit fc7945cbc3
6 changed files with 137 additions and 11 deletions
+3 -10
View File
@@ -1195,13 +1195,6 @@ if (false) {
initialise_local_config_cache();
// Allow plugins to callback as soon possible after setup.php is loaded.
$pluginswithfunction = get_plugins_with_function('after_config', 'lib.php');
foreach ($pluginswithfunction as $plugins) {
foreach ($plugins as $function) {
try {
$function();
} catch (Throwable $e) {
debugging("Exception calling '$function'", DEBUG_DEVELOPER, $e->getTrace());
}
}
}
$afterconfighook = new \core\hook\after_config();
$afterconfighook->process_legacy_callbacks();
\core\di::get(\core\hook\manager::class)->dispatch($afterconfighook);