MDL-66903 core: Introduce \core_component::reset to replace hacks
Traditionally we have done this using reflection and it would be better to do this in a 'proper' fashion in case we ever need to change how it works.
This commit is contained in:
@@ -274,7 +274,6 @@ class core_component {
|
||||
return $file;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initialise caches, always call before accessing self:: caches.
|
||||
*/
|
||||
@@ -399,6 +398,17 @@ class core_component {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset the initialisation of the component utility.
|
||||
*
|
||||
* Note: It should not be necessary to call this in regular code.
|
||||
* Please only use it where strictly required.
|
||||
*/
|
||||
public static function reset(): void {
|
||||
// The autoloader will re-initialise if plugintypes is null.
|
||||
self::$plugintypes = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Are we in developer debug mode?
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user