MDL-83704 core: Stop loading subplugins files to fetch caps
This information is heavily cached in the component class. This should be used wherever possible rather than checking on disk.
This commit is contained in:
@@ -170,15 +170,7 @@ class module extends context {
|
||||
$subcaps = array();
|
||||
|
||||
$modulepath = "{$CFG->dirroot}/mod/{$module->name}";
|
||||
if (file_exists("{$modulepath}/db/subplugins.json")) {
|
||||
$subplugins = (array) json_decode(file_get_contents("{$modulepath}/db/subplugins.json"))->plugintypes;
|
||||
} else if (file_exists("{$modulepath}/db/subplugins.php")) {
|
||||
debugging('Use of subplugins.php has been deprecated. ' .
|
||||
'Please update your plugin to provide a subplugins.json file instead.',
|
||||
DEBUG_DEVELOPER);
|
||||
$subplugins = array(); // Should be redefined in the file.
|
||||
include("{$modulepath}/db/subplugins.php");
|
||||
}
|
||||
$subplugins = \core\component::get_subplugins("mod_{$module->name}");
|
||||
|
||||
if (!empty($subplugins)) {
|
||||
foreach (array_keys($subplugins) as $subplugintype) {
|
||||
|
||||
Reference in New Issue
Block a user