MDL-87046 core: Fix shutdown manager early return

If the `\core_shutdown_manager::initialize` method is called multiple
times, it should only succeed once.

Unfortunately whilst logging existed, the shutdown manager did not
actually exit.
This commit is contained in:
Andrew Nicols
2025-11-21 08:53:03 +08:00
parent f087c4eb99
commit b7cd590de7
+1
View File
@@ -50,6 +50,7 @@ class core_shutdown_manager {
public static function initialize() {
if (self::$registered) {
debugging('Shutdown manager is already initialised!');
return;
}
self::$registered = true;
register_shutdown_function(array('core_shutdown_manager', 'shutdown_handler'));