MDL-61875 core_privacy: update the core_component_list in the manager

This commit is contained in:
Jake Dallimore 2018-04-06 10:09:33 +08:00
parent 5749f8a4f7
commit 6e6ba82305

View File

@ -298,22 +298,9 @@ class manager {
* @return array the array of frankenstyle component names.
*/
protected function get_component_list() {
$components = [];
// Get all plugins.
$plugintypes = \core_component::get_plugin_types();
foreach ($plugintypes as $plugintype => $typedir) {
$plugins = \core_component::get_plugin_list($plugintype);
foreach ($plugins as $pluginname => $plugindir) {
$components[] = $plugintype . '_' . $pluginname;
}
}
// Get all subsystems.
foreach (\core_component::get_core_subsystems() as $name => $path) {
if (isset($path)) {
$components[] = 'core_' . $name;
}
}
return $components;
return array_keys(array_reduce(\core_component::get_component_list(), function($carry, $item) {
return array_merge($carry, $item);
}, []));
}
/**