-
Bug
-
Resolution: Fixed
-
Minor
-
4.4.5, 4.5.1
Whilst working on MDL-83703 I discovered that every time we call \core\context\module::get_capabilities() we scan the file system and look for and load subplugins.json files.
From what I can tell, this change was introduced in MDL-29602 in 2011 before the component::get_subplugins() method was created via MDL-42078 in 2013.
Looking into this code, I don't believe that we should be loading from disk every time. The code only works for installed plugins, it isn't loading any new capabilities from disk anyway, so there is no benefit to it.
We also do the same thing in lib/adminlib.php in the uninstall_plugin() method. In this case we are fetching the subplugin types from the disk, but defer to the \core\component cache to actually query the plugins, which renders the subplugin fetch moot.
In both of these cases we can simply switch to using \core\component::get_subplugins($component);
- blocks
-
MDL-83705 subplugins.json should contain a list of paths relative to each plugin, nor the project root
-
- Closed
-