MDL-69415 core_h5p: prepend H5P libraries in autoloader
Core and mod_hvp are using the same namespace for some H5P libraries. This is causing some random errors. In order to get the expected behaviour in Moodle core, this patch prepends H5P libraries in order to guarantee they are loaded first. Plugins using same libraries will need to use a different namespace if they overlap and a different version of these libraries should be used.
This commit is contained in:
@@ -79,7 +79,9 @@ abstract class handler {
|
||||
* Register the H5P autoloader.
|
||||
*/
|
||||
public static function register(): void {
|
||||
spl_autoload_register([static::class, 'autoload']);
|
||||
// Prepend H5P libraries in order to guarantee they are loaded first. Plugins using same libraries will need to use a
|
||||
// different namespace if they want to use a different version.
|
||||
spl_autoload_register([static::class, 'autoload'], true, true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user