diff --git a/admin/localplugins.php b/admin/localplugins.php
index 12672b2fd06..145f65ae20e 100644
--- a/admin/localplugins.php
+++ b/admin/localplugins.php
@@ -47,7 +47,7 @@ $table->set_attribute('class', 'admintable generaltable');
 $table->setup();
 
 $plugins = array();
-foreach (get_plugin_list('local') as $plugin => $plugindir) {
+foreach (core_component::get_plugin_list('local') as $plugin => $plugindir) {
     if (get_string_manager()->string_exists('pluginname', 'local_' . $plugin)) {
         $strpluginname = get_string('pluginname', 'local_' . $plugin);
     } else {
diff --git a/admin/mnet/peer_forms.php b/admin/mnet/peer_forms.php
index 1ff7293b9cf..ce1c1c086ee 100644
--- a/admin/mnet/peer_forms.php
+++ b/admin/mnet/peer_forms.php
@@ -95,7 +95,7 @@ class mnet_review_host_form extends moodleform {
         $mform->addRule('wwwroot', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
 
         $themes = array('' => get_string('forceno'));
-        foreach (array_keys(get_plugin_list('theme')) as $themename) {
+        foreach (array_keys(core_component::get_plugin_list('theme')) as $themename) {
             $themes[$themename] = get_string('pluginname', 'theme_'.$themename);
         }
         $mform->addElement('select', 'theme', get_string('forcetheme'), $themes);
diff --git a/admin/plagiarism.php b/admin/plagiarism.php
index db2cd2f1bf6..ace710fd7bd 100644
--- a/admin/plagiarism.php
+++ b/admin/plagiarism.php
@@ -39,7 +39,7 @@ echo $OUTPUT->header();
 $txt = get_strings(array('settings', 'name', 'version'));
 $txt->uninstall = get_string('uninstallplugin', 'core_admin');
 
-$plagiarismplugins = get_plugin_list('plagiarism');
+$plagiarismplugins = core_component::get_plugin_list('plagiarism');
 if (empty($plagiarismplugins)) {
     echo $OUTPUT->notification(get_string('nopluginsinstalled', 'plagiarism'));
     echo $OUTPUT->footer();
diff --git a/admin/portfolio.php b/admin/portfolio.php
index 1811f5f774f..f5940536139 100644
--- a/admin/portfolio.php
+++ b/admin/portfolio.php
@@ -163,7 +163,7 @@ if (($action == 'edit') || ($action == 'new')) {
 
     $output = $OUTPUT->box_start('generalbox');
 
-    $plugins = get_plugin_list('portfolio');
+    $plugins = core_component::get_plugin_list('portfolio');
     $plugins = array_keys($plugins);
     $instances = portfolio_instances(false, false);
     $usedplugins = array();
diff --git a/admin/qbehaviours.php b/admin/qbehaviours.php
index 3dd14a07759..a000e0ced78 100644
--- a/admin/qbehaviours.php
+++ b/admin/qbehaviours.php
@@ -39,7 +39,7 @@ require_capability('moodle/question:config', $systemcontext);
 admin_externalpage_setup('manageqbehaviours');
 $thispageurl = new moodle_url('/admin/qbehaviours.php');
 
-$behaviours = get_plugin_list('qbehaviour');
+$behaviours = core_component::get_plugin_list('qbehaviour');
 $pluginmanager = plugin_manager::instance();
 
 // Get some data we will need - question counts and which types are needed.
diff --git a/admin/reports.php b/admin/reports.php
index 19fafdb1bf3..70ec9525d84 100644
--- a/admin/reports.php
+++ b/admin/reports.php
@@ -49,7 +49,7 @@ $table->set_attribute('class', 'generaltable generalbox boxaligncenter boxwidthw
 $table->setup();
 
 $plugins = array();
-foreach (get_plugin_list('report') as $plugin => $plugindir) {
+foreach (core_component::get_plugin_list('report') as $plugin => $plugindir) {
     if (get_string_manager()->string_exists('pluginname', 'report_' . $plugin)) {
         $strpluginname = get_string('pluginname', 'report_' . $plugin);
     } else {
diff --git a/admin/repository.php b/admin/repository.php
index aa77af99b20..50a08ee2bbc 100644
--- a/admin/repository.php
+++ b/admin/repository.php
@@ -390,7 +390,7 @@ if (($action == 'edit') || ($action == 'new')) {
     }
 
     // Get all the plugins that exist on disk
-    $plugins = get_plugin_list('repository');
+    $plugins = core_component::get_plugin_list('repository');
     if (!empty($plugins)) {
         foreach ($plugins as $plugin => $dir) {
             // Check that it has not already been listed
diff --git a/admin/settings/appearance.php b/admin/settings/appearance.php
index f9ca6d4d5d6..1367452d228 100644
--- a/admin/settings/appearance.php
+++ b/admin/settings/appearance.php
@@ -24,7 +24,7 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
     $ADMIN->add('themes', new admin_externalpage('themeselector', new lang_string('themeselector','admin'), $CFG->wwwroot . '/theme/index.php'));
 
     // settings for each theme
-    foreach (get_plugin_list('theme') as $theme => $themedir) {
+    foreach (core_component::get_plugin_list('theme') as $theme => $themedir) {
         $settings_path = "$themedir/settings.php";
         if (file_exists($settings_path)) {
             $settings = new admin_settingpage('themesetting'.$theme, new lang_string('pluginname', 'theme_'.$theme));
diff --git a/admin/settings/grades.php b/admin/settings/grades.php
index d2cc43ebcb9..b80bb4323f2 100644
--- a/admin/settings/grades.php
+++ b/admin/settings/grades.php
@@ -178,7 +178,7 @@ if (has_capability('moodle/grade:manage', $systemcontext)
 
     // Reports
     $ADMIN->add('grades', new admin_category('gradereports', new lang_string('reportsettings', 'grades')));
-    foreach (get_plugin_list('gradereport') as $plugin => $plugindir) {
+    foreach (core_component::get_plugin_list('gradereport') as $plugin => $plugindir) {
      // Include all the settings commands for this plugin if there are any
         if (file_exists($plugindir.'/settings.php')) {
             $settings = new admin_settingpage('gradereport'.$plugin, new lang_string('pluginname', 'gradereport_'.$plugin), 'moodle/grade:manage');
@@ -191,7 +191,7 @@ if (has_capability('moodle/grade:manage', $systemcontext)
 
     // Imports
     $ADMIN->add('grades', new admin_category('gradeimports', new lang_string('importsettings', 'grades')));
-    foreach (get_plugin_list('gradeimport') as $plugin => $plugindir) {
+    foreach (core_component::get_plugin_list('gradeimport') as $plugin => $plugindir) {
 
      // Include all the settings commands for this plugin if there are any
         if (file_exists($plugindir.'/settings.php')) {
@@ -206,7 +206,7 @@ if (has_capability('moodle/grade:manage', $systemcontext)
 
     // Exports
     $ADMIN->add('grades', new admin_category('gradeexports', new lang_string('exportsettings', 'grades')));
-    foreach (get_plugin_list('gradeexport') as $plugin => $plugindir) {
+    foreach (core_component::get_plugin_list('gradeexport') as $plugin => $plugindir) {
      // Include all the settings commands for this plugin if there are any
         if (file_exists($plugindir.'/settings.php')) {
             $settings = new admin_settingpage('gradeexport'.$plugin, new lang_string('pluginname', 'gradeexport_'.$plugin), 'moodle/grade:manage');
diff --git a/admin/settings/plugins.php b/admin/settings/plugins.php
index 5962355642c..502d5e667ad 100644
--- a/admin/settings/plugins.php
+++ b/admin/settings/plugins.php
@@ -382,7 +382,7 @@ $ADMIN->add('reports', new admin_externalpage('comments', new lang_string('comme
 // Course reports settings
 if ($hassiteconfig) {
     $pages = array();
-    foreach (get_plugin_list('coursereport') as $report => $path) {
+    foreach (core_component::get_plugin_list('coursereport') as $report => $path) {
         $file = $CFG->dirroot . '/course/report/' . $report . '/settings.php';
         if (file_exists($file)) {
             $settings = new admin_settingpage('coursereport' . $report,
@@ -405,7 +405,7 @@ if ($hassiteconfig) {
 
 // Now add reports
 $pages = array();
-foreach (get_plugin_list('report') as $report => $plugindir) {
+foreach (core_component::get_plugin_list('report') as $report => $plugindir) {
     $settings_path = "$plugindir/settings.php";
     if (file_exists($settings_path)) {
         $settings = new admin_settingpage('report' . $report,
@@ -431,7 +431,7 @@ if ($hassiteconfig) {
 }
 
 // Now add various admin tools
-foreach (get_plugin_list('tool') as $plugin => $plugindir) {
+foreach (core_component::get_plugin_list('tool') as $plugin => $plugindir) {
     $settings_path = "$plugindir/settings.php";
     if (file_exists($settings_path)) {
         include($settings_path);
@@ -444,7 +444,7 @@ if ($hassiteconfig) {
     $ADMIN->add('cache', new admin_externalpage('cacheconfig', new lang_string('cacheconfig', 'cache'), $CFG->wwwroot .'/cache/admin.php'));
     $ADMIN->add('cache', new admin_externalpage('cachetestperformance', new lang_string('testperformance', 'cache'), $CFG->wwwroot . '/cache/testperformance.php'));
     $ADMIN->add('cache', new admin_category('cachestores', new lang_string('cachestores', 'cache')));
-    foreach (get_plugin_list('cachestore') as $plugin => $path) {
+    foreach (core_component::get_plugin_list('cachestore') as $plugin => $path) {
         $settingspath = $path.'/settings.php';
         if (file_exists($settingspath)) {
             $settings = new admin_settingpage('cachestore_'.$plugin.'_settings', new lang_string('pluginname', 'cachestore_'.$plugin), 'moodle/site:config');
@@ -463,7 +463,7 @@ if ($hassiteconfig) {
 
 // extend settings for each local plugin. Note that their settings may be in any part of the
 // settings tree and may be visible not only for administrators. We can not use $allplugins here
-foreach (get_plugin_list('local') as $plugin => $plugindir) {
+foreach (core_component::get_plugin_list('local') as $plugin => $plugindir) {
     $settings_path = "$plugindir/settings.php";
     if (file_exists($settings_path)) {
         include($settings_path);
diff --git a/admin/tool/dbtransfer/locallib.php b/admin/tool/dbtransfer/locallib.php
index 192081860d8..190d86fc84a 100644
--- a/admin/tool/dbtransfer/locallib.php
+++ b/admin/tool/dbtransfer/locallib.php
@@ -107,7 +107,7 @@ function tool_dbtransfer_rebuild_target_log_actions(moodle_database $target, pro
         log_update_descriptions('moodle');
         $plugintypes = core_component::get_plugin_types();
         foreach ($plugintypes as $type => $location) {
-            $plugs = get_plugin_list($type);
+            $plugs = core_component::get_plugin_list($type);
             foreach ($plugs as $plug => $fullplug) {
                 $component = $type.'_'.$plug;
                 $DB->delete_records('log_display', array('component'=>$component));
diff --git a/admin/tool/qeupgradehelper/extracttestcase_form.php b/admin/tool/qeupgradehelper/extracttestcase_form.php
index d9c568bf58c..0e60dc25e71 100644
--- a/admin/tool/qeupgradehelper/extracttestcase_form.php
+++ b/admin/tool/qeupgradehelper/extracttestcase_form.php
@@ -44,7 +44,7 @@ class tool_qeupgradehelper_extract_options_form extends moodleform {
             'adaptivenopenalty' => 'Adaptive (no penalties)',
         );
 
-        $qtypes = get_plugin_list('qtype');
+        $qtypes = core_component::get_plugin_list('qtype');
         foreach ($qtypes as $qtype => $notused) {
             $qtypes[$qtype] = get_string($qtype, 'qtype_' . $qtype);
         }
diff --git a/admin/tool/uploadcourse/tests/helper_test.php b/admin/tool/uploadcourse/tests/helper_test.php
index f81c59f4a55..873e2216130 100644
--- a/admin/tool/uploadcourse/tests/helper_test.php
+++ b/admin/tool/uploadcourse/tests/helper_test.php
@@ -53,7 +53,7 @@ class tool_uploadcourse_helper_testcase extends advanced_testcase {
 
     public function test_get_course_formats() {
         $result = tool_uploadcourse_helper::get_course_formats();
-        $this->assertSame(array_keys(get_plugin_list('format')), $result);
+        $this->assertSame(array_keys(core_component::get_plugin_list('format')), $result);
         // Should be similar as first result, as cached.
         $this->assertSame($result, tool_uploadcourse_helper::get_course_formats());
     }
diff --git a/admin/tools.php b/admin/tools.php
index 51976bd2b3c..491e4511cc1 100644
--- a/admin/tools.php
+++ b/admin/tools.php
@@ -49,7 +49,7 @@ $table->set_attribute('class', 'generaltable generalbox boxaligncenter boxwidthw
 $table->setup();
 
 $plugins = array();
-foreach (get_plugin_list('tool') as $plugin => $plugindir) {
+foreach (core_component::get_plugin_list('tool') as $plugin => $plugindir) {
     if (get_string_manager()->string_exists('pluginname', 'tool_' . $plugin)) {
         $strpluginname = get_string('pluginname', 'tool_' . $plugin);
     } else {
diff --git a/admin/webservice/protocols.php b/admin/webservice/protocols.php
index 76587f29e80..6c6ff67f923 100644
--- a/admin/webservice/protocols.php
+++ b/admin/webservice/protocols.php
@@ -40,7 +40,7 @@ $webservice = optional_param('webservice', '', PARAM_SAFEDIR);
 $confirm    = optional_param('confirm', 0, PARAM_BOOL);
 
 // get currently installed and enabled auth plugins
-$available_webservices = get_plugin_list('webservice');
+$available_webservices = core_component::get_plugin_list('webservice');
 if (!empty($webservice) and empty($available_webservices[$webservice])) {
     redirect($returnurl);
 }
diff --git a/admin/webservice/testclient.php b/admin/webservice/testclient.php
index dd9dc4806da..25e4070ac5f 100644
--- a/admin/webservice/testclient.php
+++ b/admin/webservice/testclient.php
@@ -67,7 +67,7 @@ if (!isset($functions[$function])) {
 }
 
 // list all enabled webservices
-$available_protocols = get_plugin_list('webservice');
+$available_protocols = core_component::get_plugin_list('webservice');
 $active_protocols = empty($CFG->webserviceprotocols) ? array() : explode(',', $CFG->webserviceprotocols);
 $protocols = array();
 foreach ($active_protocols as $p) {
diff --git a/backup/converter/moodle1/handlerlib.php b/backup/converter/moodle1/handlerlib.php
index 94c0b1d6e35..539d804974f 100644
--- a/backup/converter/moodle1/handlerlib.php
+++ b/backup/converter/moodle1/handlerlib.php
@@ -84,7 +84,7 @@ abstract class moodle1_handlers_factory {
         global $CFG;
 
         $handlers = array();
-        $plugins = get_plugin_list($type);
+        $plugins = core_component::get_plugin_list($type);
         foreach ($plugins as $name => $dir) {
             $handlerfile  = $dir . '/backup/moodle1/lib.php';
             $handlerclass = "moodle1_{$type}_{$name}_handler";
@@ -1335,7 +1335,7 @@ class moodle1_question_bank_handler extends moodle1_xml_handler {
         if (is_null($this->qtypehandlers)) {
             // initialize the list of qtype handler instances
             $this->qtypehandlers = array();
-            foreach (get_plugin_list('qtype') as $qtypename => $qtypelocation) {
+            foreach (core_component::get_plugin_list('qtype') as $qtypename => $qtypelocation) {
                 $filename = $qtypelocation.'/backup/moodle1/lib.php';
                 if (file_exists($filename)) {
                     $classname = 'moodle1_qtype_'.$qtypename.'_handler';
diff --git a/backup/moodle2/backup_plan_builder.class.php b/backup/moodle2/backup_plan_builder.class.php
index e164ddfca83..b78fbad5063 100644
--- a/backup/moodle2/backup_plan_builder.class.php
+++ b/backup/moodle2/backup_plan_builder.class.php
@@ -50,7 +50,7 @@ require_once($CFG->dirroot . '/backup/moodle2/backup_stepslib.php');
 require_once($CFG->dirroot . '/backup/moodle2/backup_custom_fields.php');
 
 // Load all the activity tasks for moodle2 format
-$mods = get_plugin_list('mod');
+$mods = core_component::get_plugin_list('mod');
 foreach ($mods as $mod => $moddir) {
     $taskpath = $moddir . '/backup/moodle2/backup_' . $mod . '_activity_task.class.php';
     if (plugin_supports('mod', $mod, FEATURE_BACKUP_MOODLE2)) {
@@ -61,7 +61,7 @@ foreach ($mods as $mod => $moddir) {
 }
 
 // Load all the block tasks for moodle2 format
-$blocks = get_plugin_list('block');
+$blocks = core_component::get_plugin_list('block');
 foreach ($blocks as $block => $blockdir) {
     $taskpath = $blockdir . '/backup/moodle2/backup_' . $block . '_block_task.class.php';
     if (file_exists($taskpath)) {
diff --git a/backup/moodle2/backup_qtype_plugin.class.php b/backup/moodle2/backup_qtype_plugin.class.php
index d75f3d36f01..09838c25e00 100644
--- a/backup/moodle2/backup_qtype_plugin.class.php
+++ b/backup/moodle2/backup_qtype_plugin.class.php
@@ -176,7 +176,7 @@ abstract class backup_qtype_plugin extends backup_plugin {
     public static function get_components_and_fileareas($filter = null) {
         $components = array();
         // Get all the plugins of this type
-        $qtypes = get_plugin_list('qtype');
+        $qtypes = core_component::get_plugin_list('qtype');
         foreach ($qtypes as $name => $path) {
             // Apply filter if specified
             if (!is_null($filter) && $filter != $name) {
diff --git a/backup/moodle2/backup_stepslib.php b/backup/moodle2/backup_stepslib.php
index 952cc26ca28..e2f47f6498c 100644
--- a/backup/moodle2/backup_stepslib.php
+++ b/backup/moodle2/backup_stepslib.php
@@ -121,7 +121,7 @@ abstract class backup_activity_structure_step extends backup_structure_step {
         $element->add_child($optigroup); // Add optigroup to stay connected since beginning
 
         // Get all the optigroup_elements, looking across all the subplugin dirs
-        $subpluginsdirs = get_plugin_list($subplugintype);
+        $subpluginsdirs = core_component::get_plugin_list($subplugintype);
         foreach ($subpluginsdirs as $name => $subpluginsdir) {
             $classname = 'backup_' . $subplugintype . '_' . $name . '_subplugin';
             $backupfile = $subpluginsdir . '/backup/moodle2/' . $classname . '.class.php';
diff --git a/backup/moodle2/backup_xml_transformer.class.php b/backup/moodle2/backup_xml_transformer.class.php
index 25c8503bcf7..3b9a02a8658 100644
--- a/backup/moodle2/backup_xml_transformer.class.php
+++ b/backup/moodle2/backup_xml_transformer.class.php
@@ -157,7 +157,7 @@ class backup_xml_transformer extends xml_contenttransformer {
         $encoders['backup_course_task'] = 'encode_content_links';
 
         // Add the module ones. Each module supporting moodle2 backups MUST have it
-        $mods = get_plugin_list('mod');
+        $mods = core_component::get_plugin_list('mod');
         foreach ($mods as $mod => $moddir) {
             if (plugin_supports('mod', $mod, FEATURE_BACKUP_MOODLE2)) {
                 $encoders['backup_' . $mod . '_activity_task'] = 'encode_content_links';
@@ -165,7 +165,7 @@ class backup_xml_transformer extends xml_contenttransformer {
         }
 
         // Add the block encoders
-        $blocks = get_plugin_list('block');
+        $blocks = core_component::get_plugin_list('block');
         foreach ($blocks as $block => $blockdir) {
             if (class_exists('backup_' . $block . '_block_task')) {
                 $encoders['backup_' . $block . '_block_task'] = 'encode_content_links';
diff --git a/backup/moodle2/restore_plan_builder.class.php b/backup/moodle2/restore_plan_builder.class.php
index 04a91d70273..1f830ac9728 100644
--- a/backup/moodle2/restore_plan_builder.class.php
+++ b/backup/moodle2/restore_plan_builder.class.php
@@ -57,7 +57,7 @@ require_once($CFG->dirroot . '/backup/moodle2/restore_settingslib.php');
 require_once($CFG->dirroot . '/backup/moodle2/restore_stepslib.php');
 
 // Load all the activity tasks for moodle2 format
-$mods = get_plugin_list('mod');
+$mods = core_component::get_plugin_list('mod');
 foreach ($mods as $mod => $moddir) {
     $taskpath = $moddir . '/backup/moodle2/restore_' . $mod . '_activity_task.class.php';
     if (plugin_supports('mod', $mod, FEATURE_BACKUP_MOODLE2)) {
@@ -68,7 +68,7 @@ foreach ($mods as $mod => $moddir) {
 }
 
 // Load all the block tasks for moodle2 format
-$blocks = get_plugin_list('block');
+$blocks = core_component::get_plugin_list('block');
 foreach ($blocks as $block => $blockdir) {
     $taskpath = $blockdir . '/backup/moodle2/restore_' . $block . '_block_task.class.php';
     if (file_exists($taskpath)) {
diff --git a/backup/moodle2/restore_plugin.class.php b/backup/moodle2/restore_plugin.class.php
index de0d446d0a5..b90bcdf6fdd 100644
--- a/backup/moodle2/restore_plugin.class.php
+++ b/backup/moodle2/restore_plugin.class.php
@@ -135,7 +135,7 @@ abstract class restore_plugin {
         // (only the needed ones have been loaded, so they will
         // be the ones being asked here). Fetch their restore contents
         // by calling (if exists) to their define_decode_contents() method
-        $plugins = get_plugin_list($plugintype);
+        $plugins = core_component::get_plugin_list($plugintype);
         foreach ($plugins as $plugin => $plugindir) {
             $classname = 'restore_' . $plugintype . '_' . $plugin . '_plugin';
             if (class_exists($classname)) {
diff --git a/backup/moodle2/restore_stepslib.php b/backup/moodle2/restore_stepslib.php
index d25e46486c2..65241c99f61 100644
--- a/backup/moodle2/restore_stepslib.php
+++ b/backup/moodle2/restore_stepslib.php
@@ -1483,7 +1483,7 @@ class restore_course_structure_step extends restore_structure_step {
                 unset($roleids[$roleid]);
             }
 
-            foreach (get_plugin_list('mod') as $modname => $notused) {
+            foreach (core_component::get_plugin_list('mod') as $modname => $notused) {
                 if (isset($this->legacyallowedmodules[$modname])) {
                     // Module is allowed, no worries.
                     continue;
@@ -3184,7 +3184,7 @@ abstract class restore_activity_structure_step extends restore_structure_step {
              throw new restore_step_exception('incorrect_subplugin_type', $subplugintype);
         }
         // Get all the restore path elements, looking across all the subplugin dirs
-        $subpluginsdirs = get_plugin_list($subplugintype);
+        $subpluginsdirs = core_component::get_plugin_list($subplugintype);
         foreach ($subpluginsdirs as $name => $subpluginsdir) {
             $classname = 'restore_' . $subplugintype . '_' . $name . '_subplugin';
             $restorefile = $subpluginsdir . '/backup/moodle2/' . $classname . '.class.php';
diff --git a/backup/util/helper/backup_general_helper.class.php b/backup/util/helper/backup_general_helper.class.php
index 03ab11fdaf6..03225a38aae 100644
--- a/backup/util/helper/backup_general_helper.class.php
+++ b/backup/util/helper/backup_general_helper.class.php
@@ -72,7 +72,7 @@ abstract class backup_general_helper extends backup_helper {
 
         static $availableblocks = array(); // Get and cache available blocks
         if (empty($availableblocks)) {
-            $availableblocks = array_keys(get_plugin_list('block'));
+            $availableblocks = array_keys(core_component::get_plugin_list('block'));
         }
 
         $path = $path . '/blocks'; // Always look under blocks subdir
diff --git a/backup/util/helper/restore_decode_processor.class.php b/backup/util/helper/restore_decode_processor.class.php
index 66dfbef5556..0c7bf1e2cd7 100644
--- a/backup/util/helper/restore_decode_processor.class.php
+++ b/backup/util/helper/restore_decode_processor.class.php
@@ -110,7 +110,7 @@ class restore_decode_processor {
         $tasks[] = 'restore_section_task';
 
         // Add the module tasks
-        $mods = get_plugin_list('mod');
+        $mods = core_component::get_plugin_list('mod');
         foreach ($mods as $mod => $moddir) {
             if (class_exists('restore_' . $mod . '_activity_task')) {
                 $tasks[] = 'restore_' . $mod . '_activity_task';
@@ -121,7 +121,7 @@ class restore_decode_processor {
         $tasks[] = 'restore_default_block_task';
 
         // Add the custom block tasks
-        $blocks = get_plugin_list('block');
+        $blocks = core_component::get_plugin_list('block');
         foreach ($blocks as $block => $blockdir) {
             if (class_exists('restore_' . $block . '_block_task')) {
                 $tasks[] = 'restore_' . $block . '_block_task';
diff --git a/backup/util/helper/restore_logs_processor.class.php b/backup/util/helper/restore_logs_processor.class.php
index e4c8176eae8..63ff8019fe3 100644
--- a/backup/util/helper/restore_logs_processor.class.php
+++ b/backup/util/helper/restore_logs_processor.class.php
@@ -110,7 +110,7 @@ class restore_logs_processor {
         $rules = array(); // To accumulate rules for course
 
         // Add the module tasks
-        $mods = get_plugin_list('mod');
+        $mods = core_component::get_plugin_list('mod');
         foreach ($mods as $mod => $moddir) {
             if (class_exists('restore_' . $mod . '_activity_task')) {
                 $tasks[$mod] = 'restore_' . $mod . '_activity_task';
diff --git a/backup/util/plan/backup_structure_step.class.php b/backup/util/plan/backup_structure_step.class.php
index aea978c7946..9c3d0e719fe 100644
--- a/backup/util/plan/backup_structure_step.class.php
+++ b/backup/util/plan/backup_structure_step.class.php
@@ -146,7 +146,7 @@ abstract class backup_structure_step extends backup_step {
         $element->add_child($optigroup); // Add optigroup to stay connected since beginning
 
         // Get all the optigroup_elements, looking across all the plugin dirs
-        $pluginsdirs = get_plugin_list($plugintype);
+        $pluginsdirs = core_component::get_plugin_list($plugintype);
         foreach ($pluginsdirs as $name => $plugindir) {
             $classname = 'backup_' . $plugintype . '_' . $name . '_plugin';
             $backupfile = $plugindir . '/backup/moodle2/' . $classname . '.class.php';
diff --git a/backup/util/plan/restore_structure_step.class.php b/backup/util/plan/restore_structure_step.class.php
index 1432db1bdbc..0fb1a4070f5 100644
--- a/backup/util/plan/restore_structure_step.class.php
+++ b/backup/util/plan/restore_structure_step.class.php
@@ -303,7 +303,7 @@ abstract class restore_structure_step extends restore_step {
         }
 
         // Get all the restore path elements, looking across all the plugin dirs
-        $pluginsdirs = get_plugin_list($plugintype);
+        $pluginsdirs = core_component::get_plugin_list($plugintype);
         foreach ($pluginsdirs as $name => $pluginsdir) {
             // We need to add also backup plugin classes on restore, they may contain
             // some stuff used both in backup & restore
diff --git a/blocks/community/renderer.php b/blocks/community/renderer.php
index dca98393b14..fd01814f9d2 100644
--- a/blocks/community/renderer.php
+++ b/blocks/community/renderer.php
@@ -193,8 +193,8 @@ class block_community_renderer extends plugin_renderer_base {
 
 
                 //Create course content html
-                $blocks = get_plugin_list('block');
-                $activities = get_plugin_list('mod');
+                $blocks = core_component::get_plugin_list('block');
+                $activities = core_component::get_plugin_list('mod');
                 if (!empty($course->contents)) {
                     $activitieshtml = '';
                     $blockhtml = '';
diff --git a/cache/locallib.php b/cache/locallib.php
index f68d7695f6a..c28de55c85b 100644
--- a/cache/locallib.php
+++ b/cache/locallib.php
@@ -954,7 +954,7 @@ abstract class cache_administration_helper extends cache_helper {
      */
     public static function get_add_store_form($plugin) {
         global $CFG; // Needed for includes.
-        $plugins = get_plugin_list('cachestore');
+        $plugins = core_component::get_plugin_list('cachestore');
         if (!array_key_exists($plugin, $plugins)) {
             throw new coding_exception('Invalid cache plugin used when trying to create an edit form.');
         }
@@ -986,7 +986,7 @@ abstract class cache_administration_helper extends cache_helper {
      */
     public static function get_edit_store_form($plugin, $store) {
         global $CFG; // Needed for includes.
-        $plugins = get_plugin_list('cachestore');
+        $plugins = core_component::get_plugin_list('cachestore');
         if (!array_key_exists($plugin, $plugins)) {
             throw new coding_exception('Invalid cache plugin used when trying to create an edit form.');
         }
@@ -1215,7 +1215,7 @@ abstract class cache_administration_helper extends cache_helper {
      */
     public static function get_add_lock_form($plugin, array $lockplugin = null) {
         global $CFG; // Needed for includes.
-        $plugins = get_plugin_list('cachelock');
+        $plugins = core_component::get_plugin_list('cachelock');
         if (!array_key_exists($plugin, $plugins)) {
             throw new coding_exception('Invalid cache lock plugin requested when trying to create a form.');
         }
diff --git a/course/externallib.php b/course/externallib.php
index 75b400c0f04..46e43d1407e 100644
--- a/course/externallib.php
+++ b/course/externallib.php
@@ -528,7 +528,7 @@ class core_course_external extends external_api {
         $params = self::validate_parameters(self::create_courses_parameters(),
                         array('courses' => $courses));
 
-        $availablethemes = get_plugin_list('theme');
+        $availablethemes = core_component::get_plugin_list('theme');
         $availablelangs = get_string_manager()->get_list_of_translations();
 
         $transaction = $DB->start_delegated_transaction();
@@ -692,7 +692,7 @@ class core_course_external extends external_api {
         $params = self::validate_parameters(self::update_courses_parameters(),
                         array('courses' => $courses));
 
-        $availablethemes = get_plugin_list('theme');
+        $availablethemes = core_component::get_plugin_list('theme');
         $availablelangs = get_string_manager()->get_list_of_translations();
 
         foreach ($params['courses'] as $course) {
diff --git a/course/format/lib.php b/course/format/lib.php
index 5723eff8668..84017f72f4b 100644
--- a/course/format/lib.php
+++ b/course/format/lib.php
@@ -134,7 +134,7 @@ abstract class format_base {
         global $CFG;
         static $classnames = array('site' => 'format_site');
         if (!isset($classnames[$format])) {
-            $plugins = get_plugin_list('format');
+            $plugins = core_component::get_plugin_list('format');
             $usedformat = self::get_format_or_default($format);
             if (file_exists($plugins[$usedformat].'/lib.php')) {
                 require_once($plugins[$usedformat].'/lib.php');
diff --git a/course/lib.php b/course/lib.php
index 787160b6fec..28cc82af1be 100644
--- a/course/lib.php
+++ b/course/lib.php
@@ -2985,7 +2985,7 @@ function include_course_ajax($course, $usedmodules = array(), $enabledmodules =
  */
 function get_sorted_course_formats($enabledonly = false) {
     global $CFG;
-    $formats = get_plugin_list('format');
+    $formats = core_component::get_plugin_list('format');
 
     if (!empty($CFG->format_plugins_sortorder)) {
         $order = explode(',', $CFG->format_plugins_sortorder);
diff --git a/course/report.php b/course/report.php
index 5cf8d7a6b52..90b51b800fe 100644
--- a/course/report.php
+++ b/course/report.php
@@ -19,7 +19,7 @@
     $PAGE->set_heading($course->fullname.': '.$strreports);
     echo $OUTPUT->header();
 
-    $reports = get_plugin_list('coursereport');
+    $reports = core_component::get_plugin_list('coursereport');
 
     foreach ($reports as $report => $reportdirectory) {
         $pluginfile = $reportdirectory.'/mod.php';
diff --git a/grade/edit/settings/form.php b/grade/edit/settings/form.php
index b90f056c065..918d44b5ca6 100644
--- a/grade/edit/settings/form.php
+++ b/grade/edit/settings/form.php
@@ -104,7 +104,7 @@ class course_settings_form extends moodleform {
         $types = array('report', 'export', 'import');
 
         foreach($types as $type) {
-            foreach (get_plugin_list('grade'.$type) as $plugin => $plugindir) {
+            foreach (core_component::get_plugin_list('grade'.$type) as $plugin => $plugindir) {
              // Include all the settings commands for this plugin if there are any
                 if (file_exists($plugindir.'/lib.php')) {
                     require_once($plugindir.'/lib.php');
diff --git a/grade/grading/lib.php b/grade/grading/lib.php
index 70451da16eb..c0cd8ce4dee 100644
--- a/grade/grading/lib.php
+++ b/grade/grading/lib.php
@@ -253,7 +253,7 @@ class grading_manager {
             $list = array();
         }
 
-        foreach (get_plugin_list('gradingform') as $name => $location) {
+        foreach (core_component::get_plugin_list('gradingform') as $name => $location) {
             $list[$name] = get_string('pluginname', 'gradingform_'.$name);
         }
 
diff --git a/grade/lib.php b/grade/lib.php
index 7f67b190b04..c08ff66fa60 100644
--- a/grade/lib.php
+++ b/grade/lib.php
@@ -2513,7 +2513,7 @@ abstract class grade_helper {
         $context = context_course::instance($courseid);
         $gradereports = array();
         $gradepreferences = array();
-        foreach (get_plugin_list('gradereport') as $plugin => $plugindir) {
+        foreach (core_component::get_plugin_list('gradereport') as $plugin => $plugindir) {
             //some reports make no sense if we're not within a course
             if ($courseid==$SITE->id && ($plugin=='grader' || $plugin=='user')) {
                 continue;
@@ -2679,7 +2679,7 @@ abstract class grade_helper {
         $context = context_course::instance($courseid);
 
         if (has_capability('moodle/grade:import', $context)) {
-            foreach (get_plugin_list('gradeimport') as $plugin => $plugindir) {
+            foreach (core_component::get_plugin_list('gradeimport') as $plugin => $plugindir) {
                 if (!has_capability('gradeimport/'.$plugin.':view', $context)) {
                     continue;
                 }
@@ -2717,7 +2717,7 @@ abstract class grade_helper {
         $context = context_course::instance($courseid);
         $exportplugins = array();
         if (has_capability('moodle/grade:export', $context)) {
-            foreach (get_plugin_list('gradeexport') as $plugin => $plugindir) {
+            foreach (core_component::get_plugin_list('gradeexport') as $plugin => $plugindir) {
                 if (!has_capability('gradeexport/'.$plugin.':view', $context)) {
                     continue;
                 }
diff --git a/grade/report/index.php b/grade/report/index.php
index 5683fcf360d..5e7522ae073 100644
--- a/grade/report/index.php
+++ b/grade/report/index.php
@@ -36,7 +36,7 @@ require_login($course);
 $context = context_course::instance($course->id);
 
 /// find all accessible reports
-$reports = get_plugin_list('gradereport');     // Get all installed reports
+$reports = core_component::get_plugin_list('gradereport');     // Get all installed reports
 
 foreach ($reports as $plugin => $plugindir) {                      // Remove ones we can't see
     if (!has_capability('gradereport/'.$plugin.':view', $context)) {
diff --git a/lib/accesslib.php b/lib/accesslib.php
index d127a4547ce..80a1f664d39 100644
--- a/lib/accesslib.php
+++ b/lib/accesslib.php
@@ -6863,7 +6863,7 @@ class context_module extends context {
             include($subpluginsfile);
             if (!empty($subplugins)) {
                 foreach (array_keys($subplugins) as $subplugintype) {
-                    foreach (array_keys(get_plugin_list($subplugintype)) as $subpluginname) {
+                    foreach (array_keys(core_component::get_plugin_list($subplugintype)) as $subpluginname) {
                         $subcaps = array_merge($subcaps, array_keys(load_capability_def($subplugintype.'_'.$subpluginname)));
                     }
                 }
diff --git a/lib/adminlib.php b/lib/adminlib.php
index 37f7a8772c4..bc426b2ccd8 100644
--- a/lib/adminlib.php
+++ b/lib/adminlib.php
@@ -368,7 +368,7 @@ function get_component_version($component, $source='installed') {
         if ($source === 'installed') {
             return $DB->get_field('modules', 'version', array('name'=>$name));
         } else {
-            $mods = get_plugin_list('mod');
+            $mods = core_component::get_plugin_list('mod');
             if (empty($mods[$name]) or !is_readable($mods[$name].'/version.php')) {
                 return false;
             } else {
@@ -384,7 +384,7 @@ function get_component_version($component, $source='installed') {
         if ($source === 'installed') {
             return $DB->get_field('block', 'version', array('name'=>$name));
         } else {
-            $blocks = get_plugin_list('block');
+            $blocks = core_component::get_plugin_list('block');
             if (empty($blocks[$name]) or !is_readable($blocks[$name].'/version.php')) {
                 return false;
             } else {
@@ -399,7 +399,7 @@ function get_component_version($component, $source='installed') {
     if ($source === 'installed') {
         return get_config($type.'_'.$name, 'version');
     } else {
-        $plugins = get_plugin_list($type);
+        $plugins = core_component::get_plugin_list($type);
         if (empty($plugins[$name])) {
             return false;
         } else {
@@ -497,7 +497,7 @@ function get_db_directories() {
     /// Then, all the ones defined by core_component::get_plugin_types()
     $plugintypes = core_component::get_plugin_types();
     foreach ($plugintypes as $plugintype => $pluginbasedir) {
-        if ($plugins = get_plugin_list($plugintype)) {
+        if ($plugins = core_component::get_plugin_list($plugintype)) {
             foreach ($plugins as $plugin => $plugindir) {
                 $dbdirs[] = $plugindir.'/db';
             }
@@ -4732,7 +4732,7 @@ class admin_setting_special_gradeexport extends admin_setting_configmulticheckbo
         }
         $this->choices = array();
 
-        if ($plugins = get_plugin_list('gradeexport')) {
+        if ($plugins = core_component::get_plugin_list('gradeexport')) {
             foreach($plugins as $plugin => $unused) {
                 $this->choices[$plugin] = get_string('pluginname', 'gradeexport_'.$plugin);
             }
@@ -4902,7 +4902,7 @@ class admin_setting_grade_profilereport extends admin_setting_configselect {
         global $CFG;
         require_once($CFG->libdir.'/gradelib.php');
 
-        foreach (get_plugin_list('gradereport') as $plugin => $plugindir) {
+        foreach (core_component::get_plugin_list('gradereport') as $plugin => $plugindir) {
             if (file_exists($plugindir.'/lib.php')) {
                 require_once($plugindir.'/lib.php');
                 $functionname = 'grade_report_'.$plugin.'_profilereport';
@@ -5411,7 +5411,7 @@ class admin_page_manageqbehaviours extends admin_externalpage {
 
         $found = false;
         require_once($CFG->dirroot . '/question/engine/lib.php');
-        foreach (get_plugin_list('qbehaviour') as $behaviour => $notused) {
+        foreach (core_component::get_plugin_list('qbehaviour') as $behaviour => $notused) {
             if (strpos(textlib::strtolower(question_engine::get_behaviour_name($behaviour)),
                     $query) !== false) {
                 $found = true;
@@ -5499,7 +5499,7 @@ class admin_page_manageportfolios extends admin_externalpage {
         }
 
         $found = false;
-        $portfolios = get_plugin_list('portfolio');
+        $portfolios = core_component::get_plugin_list('portfolio');
         foreach ($portfolios as $p => $dir) {
             if (strpos($p, $query) !== false) {
                 $found = true;
@@ -5550,7 +5550,7 @@ class admin_page_managerepositories extends admin_externalpage {
         }
 
         $found = false;
-        $repositories= get_plugin_list('repository');
+        $repositories= core_component::get_plugin_list('repository');
         foreach ($repositories as $p => $dir) {
             if (strpos($p, $query) !== false) {
                 $found = true;
@@ -5632,7 +5632,7 @@ class admin_setting_manageauths extends admin_setting {
             return true;
         }
 
-        $authsavailable = get_plugin_list('auth');
+        $authsavailable = core_component::get_plugin_list('auth');
         foreach ($authsavailable as $auth => $dir) {
             if (strpos($auth, $query) !== false) {
                 return true;
@@ -5663,7 +5663,7 @@ class admin_setting_manageauths extends admin_setting {
             'up', 'down', 'none'));
         $txt->updown = "$txt->up/$txt->down";
 
-        $authsavailable = get_plugin_list('auth');
+        $authsavailable = core_component::get_plugin_list('auth');
         get_enabled_auth_plugins(true); // fix the list of enabled auths
         if (empty($CFG->auth)) {
             $authsenabled = array();
@@ -6782,7 +6782,7 @@ function db_replace($search, $replace) {
     rebuild_course_cache(0, true);
 
     // TODO: we should ask all plugins to do the search&replace, for now let's do only blocks...
-    $blocks = get_plugin_list('block');
+    $blocks = core_component::get_plugin_list('block');
     foreach ($blocks as $blockname=>$fullblock) {
         if ($blockname === 'NEWBLOCK') {   // Someone has unzipped the template, ignore it
             continue;
@@ -6875,7 +6875,7 @@ class admin_setting_managerepository extends admin_setting {
             return true;
         }
 
-        $repositories= get_plugin_list('repository');
+        $repositories= core_component::get_plugin_list('repository');
         foreach ($repositories as $p => $dir) {
             if (strpos($p, $query) !== false) {
                 return true;
@@ -7040,7 +7040,7 @@ class admin_setting_managerepository extends admin_setting {
         }
 
         // Get all the plugins that exist on disk
-        $plugins = get_plugin_list('repository');
+        $plugins = core_component::get_plugin_list('repository');
         if (!empty($plugins)) {
             foreach ($plugins as $plugin => $dir) {
                 // Check that it has not already been listed
@@ -7784,7 +7784,7 @@ class admin_setting_managewebserviceprotocols extends admin_setting {
             return true;
         }
 
-        $protocols = get_plugin_list('webservice');
+        $protocols = core_component::get_plugin_list('webservice');
         foreach ($protocols as $protocol=>$location) {
             if (strpos($protocol, $query) !== false) {
                 return true;
@@ -7816,7 +7816,7 @@ class admin_setting_managewebserviceprotocols extends admin_setting {
         $strdisable = get_string('disable');
         $strversion = get_string('version');
 
-        $protocols_available = get_plugin_list('webservice');
+        $protocols_available = core_component::get_plugin_list('webservice');
         $active_protocols = empty($CFG->webserviceprotocols) ? array() : explode(',', $CFG->webserviceprotocols);
         ksort($protocols_available);
 
diff --git a/lib/cronlib.php b/lib/cronlib.php
index 0e7bbe148ac..80d2a18c9ce 100644
--- a/lib/cronlib.php
+++ b/lib/cronlib.php
@@ -443,7 +443,7 @@ function cron_run() {
 
 
     // and finally run any local cronjobs, if any
-    if ($locals = get_plugin_list('local')) {
+    if ($locals = core_component::get_plugin_list('local')) {
         mtrace('Processing customized cron scripts ...', '');
         // new cron functions in lib.php first
         cron_execute_plugin_type('local');
@@ -589,7 +589,7 @@ function cron_bc_hack_plugin_functions($plugintype, $plugins) {
     if ($plugintype === 'report') {
         // Admin reports only - not course report because course report was
         // never implemented before, so doesn't need BC
-        foreach (get_plugin_list($plugintype) as $pluginname=>$dir) {
+        foreach (core_component::get_plugin_list($plugintype) as $pluginname=>$dir) {
             $component = $plugintype . '_' . $pluginname;
             if (isset($plugins[$component])) {
                 // We already have detected the function using the new API
@@ -612,7 +612,7 @@ function cron_bc_hack_plugin_functions($plugintype, $plugins) {
         // Detect old style cron function names
         // Plugin gradeexport_frog used to use grade_export_frog_cron() instead of
         // new standard API gradeexport_frog_cron(). Also applies to gradeimport, gradereport
-        foreach(get_plugin_list($plugintype) as $pluginname=>$dir) {
+        foreach(core_component::get_plugin_list($plugintype) as $pluginname=>$dir) {
             $component = $plugintype.'_'.$pluginname;
             if (isset($plugins[$component])) {
                 // We already have detected the function using the new API
diff --git a/lib/editor/tinymce/adminlib.php b/lib/editor/tinymce/adminlib.php
index 8e57b69ab5d..882e387f390 100644
--- a/lib/editor/tinymce/adminlib.php
+++ b/lib/editor/tinymce/adminlib.php
@@ -135,7 +135,7 @@ class tiynce_subplugins_settings extends admin_setting {
             return true;
         }
 
-        $subplugins = get_plugin_list('tinymce');
+        $subplugins = core_component::get_plugin_list('tinymce');
         foreach ($subplugins as $name=>$dir) {
             if (stripos($name, $query) !== false) {
                 return true;
@@ -173,7 +173,7 @@ class tiynce_subplugins_settings extends admin_setting {
         $struninstall = get_string('uninstallplugin', 'core_admin');
         $strversion = get_string('version');
 
-        $subplugins = get_plugin_list('tinymce');
+        $subplugins = core_component::get_plugin_list('tinymce');
 
         $return = $OUTPUT->heading(get_string('subplugintype_tinymce_plural', 'editor_tinymce'), 3, 'main', true);
         $return .= $OUTPUT->box_start('generalbox tinymcesubplugins');
diff --git a/lib/editor/tinymce/all_strings.php b/lib/editor/tinymce/all_strings.php
index 0758f43c6ec..de13312e415 100644
--- a/lib/editor/tinymce/all_strings.php
+++ b/lib/editor/tinymce/all_strings.php
@@ -68,7 +68,7 @@ foreach ($string as $key=>$value) {
 }
 
 // Add subplugin strings, accept only those with proper pluginname prefix with colon.
-foreach (get_plugin_list('tinymce') as $component => $ignored) {
+foreach (core_component::get_plugin_list('tinymce') as $component => $ignored) {
     $componentstrings = get_string_manager()->load_component_strings(
             'tinymce_' . $component, $lang);
     foreach ($componentstrings as $key => $value) {
diff --git a/lib/editor/tinymce/classes/plugin.php b/lib/editor/tinymce/classes/plugin.php
index 349673adb37..6d41b25c545 100644
--- a/lib/editor/tinymce/classes/plugin.php
+++ b/lib/editor/tinymce/classes/plugin.php
@@ -378,7 +378,7 @@ abstract class editor_tinymce_plugin {
         global $CFG;
 
         // Get list of plugin directories.
-        $plugins = get_plugin_list('tinymce');
+        $plugins = core_component::get_plugin_list('tinymce');
 
         // Get list of disabled subplugins.
         $disabled = array();
diff --git a/lib/editorlib.php b/lib/editorlib.php
index 4c73e1d3418..8080d804d42 100644
--- a/lib/editorlib.php
+++ b/lib/editorlib.php
@@ -158,7 +158,7 @@ function get_texteditor($editorname) {
  */
 function editors_get_available() {
     $editors = array();
-    foreach (get_plugin_list('editor') as $editorname => $dir) {
+    foreach (core_component::get_plugin_list('editor') as $editorname => $dir) {
         $editors[$editorname] = get_string('pluginname', 'editor_'.$editorname);
     }
     return $editors;
diff --git a/lib/enrollib.php b/lib/enrollib.php
index 7e70bff7e2f..b000654b41c 100644
--- a/lib/enrollib.php
+++ b/lib/enrollib.php
@@ -86,7 +86,7 @@ function enrol_get_plugins($enabled) {
         }
     } else {
         // sorted alphabetically
-        $plugins = get_plugin_list('enrol');
+        $plugins = core_component::get_plugin_list('enrol');
         ksort($plugins);
     }
 
diff --git a/lib/filterlib.php b/lib/filterlib.php
index 624ceadefbf..fb674fffc91 100644
--- a/lib/filterlib.php
+++ b/lib/filterlib.php
@@ -513,7 +513,7 @@ function filter_get_all_installed() {
     global $CFG;
 
     $filternames = array();
-    foreach (get_plugin_list('filter') as $filter => $fulldir) {
+    foreach (core_component::get_plugin_list('filter') as $filter => $fulldir) {
         if (is_readable("$fulldir/filter.php")) {
             $filternames[$filter] = filter_get_name($filter);
         }
diff --git a/lib/gradelib.php b/lib/gradelib.php
index e95a2af3db4..fc026170614 100644
--- a/lib/gradelib.php
+++ b/lib/gradelib.php
@@ -1138,7 +1138,7 @@ function grade_grab_course_grades($courseid, $modname=null, $userid=0) {
         return;
     }
 
-    if (!$mods = get_plugin_list('mod') ) {
+    if (!$mods = core_component::get_plugin_list('mod') ) {
         print_error('nomodules', 'debug');
     }
 
diff --git a/lib/moodlelib.php b/lib/moodlelib.php
index a8ef132b197..f79a2dbe7ca 100644
--- a/lib/moodlelib.php
+++ b/lib/moodlelib.php
@@ -8215,7 +8215,7 @@ function get_plugin_list_with_function($plugintype, $function, $file = 'lib.php'
  * Lists plugin-like directories within specified directory
  *
  * This function was originally used for standard Moodle plugins, please use
- * new get_plugin_list() now.
+ * new core_component::get_plugin_list() now.
  *
  * This function is used for general directory listing and backwards compatility.
  *
diff --git a/lib/navigationlib.php b/lib/navigationlib.php
index 258d2731dde..776e293a1e7 100644
--- a/lib/navigationlib.php
+++ b/lib/navigationlib.php
@@ -2222,7 +2222,7 @@ class global_navigation extends navigation_node {
         } else if ($course->id == $SITE->id && has_capability('moodle/user:viewdetails', $usercontext) && (!in_array('mycourses', $hiddenfields) || has_capability('moodle/user:viewhiddendetails', $coursecontext))) {
 
             // Add view grade report is permitted
-            $reports = get_plugin_list('gradereport');
+            $reports = core_component::get_plugin_list('gradereport');
             arsort($reports); // user is last, we want to test it first
 
             $userscourses = enrol_get_users_courses($user->id);
@@ -3572,7 +3572,7 @@ class settings_navigation extends navigation_node {
         if (has_capability('moodle/site:viewreports', $coursecontext)) { // Basic capability for listing of reports.
             $reportnav = $coursenode->add(get_string('reports'), null, self::TYPE_CONTAINER, null, null,
                     new pix_icon('i/stats', ''));
-            $coursereports = get_plugin_list('coursereport');
+            $coursereports = core_component::get_plugin_list('coursereport');
             foreach ($coursereports as $report => $dir) {
                 $libfile = $CFG->dirroot.'/course/report/'.$report.'/lib.php';
                 if (file_exists($libfile)) {
@@ -3595,7 +3595,7 @@ class settings_navigation extends navigation_node {
         if (has_capability('moodle/grade:viewall', $coursecontext)) {
             $reportavailable = true;
         } else if (!empty($course->showgrades)) {
-            $reports = get_plugin_list('gradereport');
+            $reports = core_component::get_plugin_list('gradereport');
             if (is_array($reports) && count($reports)>0) {     // Get all installed reports
                 arsort($reports); // user is last, we want to test it first
                 foreach ($reports as $plugin => $plugindir) {
@@ -4297,7 +4297,7 @@ class settings_navigation extends navigation_node {
         if (has_capability('moodle/site:viewreports', $coursecontext)) { // Basic capability for listing of reports.
             $frontpagenav = $frontpage->add(get_string('reports'), null, self::TYPE_CONTAINER, null, null,
                     new pix_icon('i/stats', ''));
-            $coursereports = get_plugin_list('coursereport');
+            $coursereports = core_component::get_plugin_list('coursereport');
             foreach ($coursereports as $report=>$dir) {
                 $libfile = $CFG->dirroot.'/course/report/'.$report.'/lib.php';
                 if (file_exists($libfile)) {
diff --git a/lib/outputlib.php b/lib/outputlib.php
index 26ed10261fe..03407525f6e 100644
--- a/lib/outputlib.php
+++ b/lib/outputlib.php
@@ -609,7 +609,7 @@ class theme_config {
         $files = array();
 
         // first editor plugins
-        $plugins = get_plugin_list('editor');
+        $plugins = core_component::get_plugin_list('editor');
         foreach ($plugins as $plugin=>$fulldir) {
             $sheetfile = "$fulldir/editor_styles.css";
             if (is_readable($sheetfile)) {
@@ -778,7 +778,7 @@ class theme_config {
                 if ($type === 'theme' || (!empty($excludes[$type]) and $excludes[$type] === true)) {
                     continue;
                 }
-                $plugins = get_plugin_list($type);
+                $plugins = core_component::get_plugin_list($type);
                 foreach ($plugins as $plugin=>$fulldir) {
                     if (!empty($excludes[$type]) and is_array($excludes[$type])
                         and in_array($plugin, $excludes[$type])) {
diff --git a/lib/outputrequirementslib.php b/lib/outputrequirementslib.php
index d750713a411..517d441b217 100644
--- a/lib/outputrequirementslib.php
+++ b/lib/outputrequirementslib.php
@@ -1665,7 +1665,7 @@ class YUI_config {
         // And finally the plugins.
         $plugintypes = core_component::get_plugin_types();
         foreach ($plugintypes as $plugintype => $pathroot) {
-            $pluginlist = get_plugin_list($plugintype);
+            $pluginlist = core_component::get_plugin_list($plugintype);
             foreach ($pluginlist as $plugin => $path) {
                 if ($module = $this->get_moodle_path_metadata($path)) {
                     $moodlemodules = array_merge($moodlemodules, $module);
diff --git a/lib/phpunit/classes/util.php b/lib/phpunit/classes/util.php
index 471de07daa4..b04940904b5 100644
--- a/lib/phpunit/classes/util.php
+++ b/lib/phpunit/classes/util.php
@@ -459,7 +459,7 @@ class phpunit_util extends testing_util {
         $plugintypes = core_component::get_plugin_types();
         ksort($plugintypes);
         foreach ($plugintypes as $type=>$unused) {
-            $plugs = get_plugin_list($type);
+            $plugs = core_component::get_plugin_list($type);
             ksort($plugs);
             foreach ($plugs as $plug=>$fullplug) {
                 if (!file_exists("$fullplug/tests/")) {
diff --git a/lib/plagiarismlib.php b/lib/plagiarismlib.php
index 59272134c93..566587d7492 100644
--- a/lib/plagiarismlib.php
+++ b/lib/plagiarismlib.php
@@ -188,7 +188,7 @@ function plagiarism_load_available_plugins() {
     if (empty($CFG->enableplagiarism)) {
         return array();
     }
-    $plagiarismplugins = get_plugin_list('plagiarism');
+    $plagiarismplugins = core_component::get_plugin_list('plagiarism');
     $availableplugins = array();
     foreach($plagiarismplugins as $plugin => $dir) {
         //check this plugin is enabled and a lib file exists.
diff --git a/lib/pluginlib.php b/lib/pluginlib.php
index 3f598f77ff5..cf7a75101c6 100644
--- a/lib/pluginlib.php
+++ b/lib/pluginlib.php
@@ -2460,7 +2460,7 @@ abstract class plugininfo_base {
     public static function get_plugins($type, $typerootdir, $typeclass) {
 
         // get the information about plugins at the disk
-        $plugins = get_plugin_list($type);
+        $plugins = core_component::get_plugin_list($type);
         $ondisk = array();
         foreach ($plugins as $pluginname => $pluginrootdir) {
             $ondisk[$pluginname] = plugininfo_default_factory::make($type, $typerootdir,
diff --git a/lib/portfoliolib.php b/lib/portfoliolib.php
index 1b42e436a64..2cff7a0e140 100644
--- a/lib/portfoliolib.php
+++ b/lib/portfoliolib.php
@@ -815,7 +815,7 @@ function portfolio_plugin_sanity_check($plugins=null) {
     if (is_string($plugins)) {
         $plugins = array($plugins);
     } else if (empty($plugins)) {
-        $plugins = get_plugin_list('portfolio');
+        $plugins = core_component::get_plugin_list('portfolio');
         $plugins = array_keys($plugins);
     }
 
diff --git a/lib/questionlib.php b/lib/questionlib.php
index 71734e51f59..86abddccdb7 100644
--- a/lib/questionlib.php
+++ b/lib/questionlib.php
@@ -138,7 +138,7 @@ function questions_in_use($questionids) {
         return true;
     }
 
-    foreach (get_plugin_list('mod') as $module => $path) {
+    foreach (core_component::get_plugin_list('mod') as $module => $path) {
         $lib = $path . '/lib.php';
         if (is_readable($lib)) {
             include_once($lib);
diff --git a/lib/testing/classes/tests_finder.php b/lib/testing/classes/tests_finder.php
index 10d98172e02..666e34087fb 100644
--- a/lib/testing/classes/tests_finder.php
+++ b/lib/testing/classes/tests_finder.php
@@ -66,7 +66,7 @@ class tests_finder {
         $plugintypes = core_component::get_plugin_types();
         ksort($plugintypes);
         foreach ($plugintypes as $type => $unused) {
-            $plugs = get_plugin_list($type);
+            $plugs = core_component::get_plugin_list($type);
             ksort($plugs);
             foreach ($plugs as $plug => $fullplug) {
                 // Look for tests recursively
diff --git a/lib/testing/classes/util.php b/lib/testing/classes/util.php
index e51865cb33f..71ebacc7de7 100644
--- a/lib/testing/classes/util.php
+++ b/lib/testing/classes/util.php
@@ -690,7 +690,7 @@ abstract class testing_util {
         $versions['core'] = $version;
 
         // modules
-        $mods = get_plugin_list('mod');
+        $mods = core_component::get_plugin_list('mod');
         ksort($mods);
         foreach ($mods as $mod => $fullmod) {
             $module = new stdClass();
@@ -704,7 +704,7 @@ abstract class testing_util {
         unset($plugintypes['mod']);
         ksort($plugintypes);
         foreach ($plugintypes as $type => $unused) {
-            $plugs = get_plugin_list($type);
+            $plugs = core_component::get_plugin_list($type);
             ksort($plugs);
             foreach ($plugs as $plug => $fullplug) {
                 $plugin = new stdClass();
diff --git a/lib/upgradelib.php b/lib/upgradelib.php
index cf4b15c1018..a84fc7abf3d 100644
--- a/lib/upgradelib.php
+++ b/lib/upgradelib.php
@@ -385,7 +385,7 @@ function upgrade_plugins($type, $startcallback, $endcallback, $verbose) {
         return upgrade_plugins_blocks($startcallback, $endcallback, $verbose);
     }
 
-    $plugs = get_plugin_list($type);
+    $plugs = core_component::get_plugin_list($type);
 
     foreach ($plugs as $plug=>$fullplug) {
         // Reset time so that it works when installing a large number of plugins
@@ -540,7 +540,7 @@ function upgrade_plugins($type, $startcallback, $endcallback, $verbose) {
 function upgrade_plugins_modules($startcallback, $endcallback, $verbose) {
     global $CFG, $DB;
 
-    $mods = get_plugin_list('mod');
+    $mods = core_component::get_plugin_list('mod');
 
     foreach ($mods as $mod=>$fullmod) {
 
@@ -715,7 +715,7 @@ function upgrade_plugins_blocks($startcallback, $endcallback, $verbose) {
     //Is this a first install
     $first_install = null;
 
-    $blocks = get_plugin_list('block');
+    $blocks = core_component::get_plugin_list('block');
 
     foreach ($blocks as $blockname=>$fullblock) {
 
diff --git a/mod/assign/adminlib.php b/mod/assign/adminlib.php
index 2a78c0ac4a7..45703624e6a 100644
--- a/mod/assign/adminlib.php
+++ b/mod/assign/adminlib.php
@@ -65,7 +65,7 @@ class assign_admin_page_manage_assign_plugins extends admin_externalpage {
         $found = false;
         $textlib = new textlib();
 
-        foreach (get_plugin_list($this->subtype) as $name => $notused) {
+        foreach (core_component::get_plugin_list($this->subtype) as $name => $notused) {
             if (strpos($textlib::strtolower(get_string('pluginname', $this->subtype . '_' . $name)),
                     $query) !== false) {
                 $found = true;
@@ -116,7 +116,7 @@ class assign_plugin_manager {
      * @return array The list of plugins
      */
     public function get_sorted_plugins_list() {
-        $names = get_plugin_list($this->subtype);
+        $names = core_component::get_plugin_list($this->subtype);
 
         $result = array();
 
diff --git a/mod/assign/assignmentplugin.php b/mod/assign/assignmentplugin.php
index f3c68c40b18..cda69f19dd5 100644
--- a/mod/assign/assignmentplugin.php
+++ b/mod/assign/assignmentplugin.php
@@ -75,7 +75,7 @@ abstract class assign_plugin {
      * @return bool
      */
     public final function is_last() {
-        $lastindex = count(get_plugin_list($this->get_subtype()))-1;
+        $lastindex = count(core_component::get_plugin_list($this->get_subtype()))-1;
         $currentindex = get_config($this->get_subtype() . '_' . $this->get_type(), 'sortorder');
         if ($lastindex == $currentindex) {
             return true;
diff --git a/mod/assign/lib.php b/mod/assign/lib.php
index 0cff70dff91..49a13f10260 100644
--- a/mod/assign/lib.php
+++ b/mod/assign/lib.php
@@ -858,7 +858,7 @@ function assign_cron() {
     require_once($CFG->dirroot . '/mod/assign/locallib.php');
     assign::cron();
 
-    $plugins = get_plugin_list('assignsubmission');
+    $plugins = core_component::get_plugin_list('assignsubmission');
 
     foreach ($plugins as $name => $plugin) {
         $disabled = get_config('assignsubmission_' . $name, 'disabled');
@@ -868,7 +868,7 @@ function assign_cron() {
             $class::cron();
         }
     }
-    $plugins = get_plugin_list('assignfeedback');
+    $plugins = core_component::get_plugin_list('assignfeedback');
 
     foreach ($plugins as $name => $plugin) {
         $disabled = get_config('assignfeedback_' . $name, 'disabled');
diff --git a/mod/assign/locallib.php b/mod/assign/locallib.php
index 290235f3caf..f29ed2a672d 100644
--- a/mod/assign/locallib.php
+++ b/mod/assign/locallib.php
@@ -331,7 +331,7 @@ class assign {
         global $CFG;
         $result = array();
 
-        $names = get_plugin_list($subtype);
+        $names = core_component::get_plugin_list($subtype);
 
         foreach ($names as $name => $path) {
             if (file_exists($path . '/locallib.php')) {
diff --git a/mod/assign/settings.php b/mod/assign/settings.php
index bc8c1c31346..038d31e4706 100644
--- a/mod/assign/settings.php
+++ b/mod/assign/settings.php
@@ -40,7 +40,7 @@ assign_plugin_manager::add_admin_assign_plugin_settings('assignfeedback', $ADMIN
 
 if ($ADMIN->fulltree) {
     $menu = array();
-    foreach (get_plugin_list('assignfeedback') as $type => $notused) {
+    foreach (core_component::get_plugin_list('assignfeedback') as $type => $notused) {
         $visible = !get_config('assignfeedback_' . $type, 'disabled');
         if ($visible) {
             $menu['assignfeedback_' . $type] = new lang_string('pluginname', 'assignfeedback_' . $type);
diff --git a/mod/assign/tests/locallib_test.php b/mod/assign/tests/locallib_test.php
index ba5f13581ad..e7054db6d7f 100644
--- a/mod/assign/tests/locallib_test.php
+++ b/mod/assign/tests/locallib_test.php
@@ -54,7 +54,7 @@ class mod_assign_locallib_testcase extends mod_assign_base_testcase {
     public function test_get_feedback_plugins() {
         $this->setUser($this->editingteachers[0]);
         $assign = $this->create_instance();
-        $installedplugins = array_keys(get_plugin_list('assignfeedback'));
+        $installedplugins = array_keys(core_component::get_plugin_list('assignfeedback'));
 
         foreach ($assign->get_feedback_plugins() as $plugin) {
             $this->assertContains($plugin->get_type(), $installedplugins, 'Feedback plugin not in list of installed plugins');
@@ -64,7 +64,7 @@ class mod_assign_locallib_testcase extends mod_assign_base_testcase {
     public function test_get_submission_plugins() {
         $this->setUser($this->editingteachers[0]);
         $assign = $this->create_instance();
-        $installedplugins = array_keys(get_plugin_list('assignsubmission'));
+        $installedplugins = array_keys(core_component::get_plugin_list('assignsubmission'));
 
         foreach ($assign->get_submission_plugins() as $plugin) {
             $this->assertContains($plugin->get_type(), $installedplugins, 'Submission plugin not in list of installed plugins');
diff --git a/mod/assignment/backup/moodle1/lib.php b/mod/assignment/backup/moodle1/lib.php
index 68c955292f4..b61bea06f1a 100644
--- a/mod/assignment/backup/moodle1/lib.php
+++ b/mod/assignment/backup/moodle1/lib.php
@@ -173,7 +173,7 @@ class moodle1_mod_assignment_handler extends moodle1_mod_handler {
 
         if (is_null($this->subpluginhandlers)) {
             $this->subpluginhandlers = array();
-            $subplugins = get_plugin_list('assignment');
+            $subplugins = core_component::get_plugin_list('assignment');
             foreach ($subplugins as $name => $dir) {
                 $handlerfile  = $dir.'/backup/moodle1/lib.php';
                 $handlerclass = "moodle1_mod_assignment_{$name}_subplugin_handler";
diff --git a/mod/assignment/lib.php b/mod/assignment/lib.php
index ba560cff26c..7065ce53980 100644
--- a/mod/assignment/lib.php
+++ b/mod/assignment/lib.php
@@ -2825,7 +2825,7 @@ function assignment_cron () {
     global $CFG, $USER, $DB;
 
     /// first execute all crons in plugins
-    if ($plugins = get_plugin_list('assignment')) {
+    if ($plugins = core_component::get_plugin_list('assignment')) {
         foreach ($plugins as $plugin=>$dir) {
             require_once("$dir/assignment.class.php");
             $assignmentclass = "assignment_$plugin";
@@ -3637,7 +3637,7 @@ function assignment_get_coursemodule_info($coursemodule) {
  */
 function assignment_types() {
     $types = array();
-    $names = get_plugin_list('assignment');
+    $names = core_component::get_plugin_list('assignment');
     foreach ($names as $name=>$dir) {
         $types[$name] = get_string('type'.$name, 'assignment');
 
@@ -3820,7 +3820,7 @@ function assignment_get_types() {
     }
 
     /// Drop-in extra assignment types
-    $assignmenttypes = get_plugin_list('assignment');
+    $assignmenttypes = core_component::get_plugin_list('assignment');
     foreach ($assignmenttypes as $assignmenttype=>$fulldir) {
         if (!empty($CFG->{'assignment_hide_'.$assignmenttype})) {  // Not wanted
             continue;
@@ -3880,7 +3880,7 @@ function assignment_reset_userdata($data) {
     global $CFG;
 
     $status = array();
-    foreach (get_plugin_list('assignment') as $type=>$dir) {
+    foreach (core_component::get_plugin_list('assignment') as $type=>$dir) {
         require_once("$dir/assignment.class.php");
         $assignmentclass = "assignment_$type";
         $ass = new $assignmentclass();
diff --git a/mod/book/lib.php b/mod/book/lib.php
index b6307f73f87..9b2eb211c87 100644
--- a/mod/book/lib.php
+++ b/mod/book/lib.php
@@ -229,7 +229,7 @@ function book_get_view_actions() {
 
     $return = array('view', 'view all');
 
-    $plugins = get_plugin_list('booktool');
+    $plugins = core_component::get_plugin_list('booktool');
     foreach ($plugins as $plugin => $dir) {
         if (file_exists("$dir/lib.php")) {
             require_once("$dir/lib.php");
@@ -254,7 +254,7 @@ function book_get_post_actions() {
 
     $return = array('update');
 
-    $plugins = get_plugin_list('booktool');
+    $plugins = core_component::get_plugin_list('booktool');
     foreach ($plugins as $plugin => $dir) {
         if (file_exists("$dir/lib.php")) {
             require_once("$dir/lib.php");
@@ -303,7 +303,7 @@ function book_supports($feature) {
 function book_extend_settings_navigation(settings_navigation $settingsnav, navigation_node $booknode) {
     global $USER, $PAGE;
 
-    $plugins = get_plugin_list('booktool');
+    $plugins = core_component::get_plugin_list('booktool');
     foreach ($plugins as $plugin => $dir) {
         if (file_exists("$dir/lib.php")) {
             require_once("$dir/lib.php");
diff --git a/mod/data/field.php b/mod/data/field.php
index 4a08a41118f..a24d6284139 100644
--- a/mod/data/field.php
+++ b/mod/data/field.php
@@ -240,7 +240,7 @@ switch ($mode) {
 /// Print the browsing interface
 
 ///get the list of possible fields (plugins)
-$plugins = get_plugin_list('datafield');
+$plugins = core_component::get_plugin_list('datafield');
 $menufield = array();
 
 foreach ($plugins as $plugin=>$fulldir){
diff --git a/mod/data/lib.php b/mod/data/lib.php
index 2da45f7cc28..eecd8acfd5f 100644
--- a/mod/data/lib.php
+++ b/mod/data/lib.php
@@ -1877,7 +1877,7 @@ function data_get_available_presets($context) {
     $presets = array();
 
     // First load the ratings sub plugins that exist within the modules preset dir
-    if ($dirs = get_plugin_list('datapreset')) {
+    if ($dirs = core_component::get_plugin_list('datapreset')) {
         foreach ($dirs as $dir=>$fulldir) {
             if (is_directory_a_preset($fulldir)) {
                 $preset = new stdClass();
diff --git a/mod/lesson/lib.php b/mod/lesson/lib.php
index 56eead8cafb..a94c4a9dfe2 100644
--- a/mod/lesson/lib.php
+++ b/mod/lesson/lib.php
@@ -803,7 +803,7 @@ function lesson_extend_settings_navigation($settings, $lessonnode) {
  */
 function lesson_get_import_export_formats($type) {
     global $CFG;
-    $fileformats = get_plugin_list("qformat");
+    $fileformats = core_component::get_plugin_list("qformat");
 
     $fileformatname=array();
     foreach ($fileformats as $fileformat=>$fdir) {
diff --git a/mod/quiz/db/upgrade.php b/mod/quiz/db/upgrade.php
index 89d2dfc8e8b..da853983220 100644
--- a/mod/quiz/db/upgrade.php
+++ b/mod/quiz/db/upgrade.php
@@ -113,7 +113,7 @@ function xmldb_quiz_upgrade($oldversion) {
         // Get a list of response variables that have files.
         require_once($CFG->dirroot . '/question/type/questiontypebase.php');
         $variables = array();
-        foreach (get_plugin_list('qtype') as $qtypename => $path) {
+        foreach (core_component::get_plugin_list('qtype') as $qtypename => $path) {
             $file = $path . '/questiontype.php';
             if (!is_readable($file)) {
                 continue;
diff --git a/mod/quiz/report/reportlib.php b/mod/quiz/report/reportlib.php
index 344513e5afe..bc88dc84f8c 100644
--- a/mod/quiz/report/reportlib.php
+++ b/mod/quiz/report/reportlib.php
@@ -331,7 +331,7 @@ function quiz_report_list($context) {
     }
 
     $reports = $DB->get_records('quiz_reports', null, 'displayorder DESC', 'name, capability');
-    $reportdirs = get_plugin_list('quiz');
+    $reportdirs = core_component::get_plugin_list('quiz');
 
     // Order the reports tab in descending order of displayorder.
     $reportcaps = array();
diff --git a/mod/scorm/report/reportlib.php b/mod/scorm/report/reportlib.php
index d6d50c6fd8b..2b16607e9bd 100644
--- a/mod/scorm/report/reportlib.php
+++ b/mod/scorm/report/reportlib.php
@@ -35,7 +35,7 @@ function scorm_report_list($context) {
     if (!empty($reportlist)) {
         return $reportlist;
     }
-    $installed = get_plugin_list('scormreport');
+    $installed = core_component::get_plugin_list('scormreport');
     foreach ($installed as $reportname => $notused) {
         $pluginfile = $CFG->dirroot.'/mod/scorm/report/'.$reportname.'/report.php';
         if (is_readable($pluginfile)) {
diff --git a/mod/workshop/backup/moodle1/lib.php b/mod/workshop/backup/moodle1/lib.php
index 4405280c6e3..bbb6aec0e6e 100644
--- a/mod/workshop/backup/moodle1/lib.php
+++ b/mod/workshop/backup/moodle1/lib.php
@@ -268,7 +268,7 @@ class moodle1_mod_workshop_handler extends moodle1_mod_handler {
 
         if (is_null($this->strategyhandlers)) {
             $this->strategyhandlers = array();
-            $subplugins = get_plugin_list('workshopform');
+            $subplugins = core_component::get_plugin_list('workshopform');
             foreach ($subplugins as $name => $dir) {
                 $handlerfile  = $dir.'/backup/moodle1/lib.php';
                 $handlerclass = "moodle1_workshopform_{$name}_handler";
diff --git a/mod/workshop/lib.php b/mod/workshop/lib.php
index 54d74b44881..b4ad846bfa2 100644
--- a/mod/workshop/lib.php
+++ b/mod/workshop/lib.php
@@ -211,21 +211,21 @@ function workshop_delete_instance($id) {
     $DB->delete_records_list('workshop_submissions', 'id', array_keys($submissions));
 
     // call the static clean-up methods of all available subplugins
-    $strategies = get_plugin_list('workshopform');
+    $strategies = core_component::get_plugin_list('workshopform');
     foreach ($strategies as $strategy => $path) {
         require_once($path.'/lib.php');
         $classname = 'workshop_'.$strategy.'_strategy';
         call_user_func($classname.'::delete_instance', $workshop->id);
     }
 
-    $allocators = get_plugin_list('workshopallocation');
+    $allocators = core_component::get_plugin_list('workshopallocation');
     foreach ($allocators as $allocator => $path) {
         require_once($path.'/lib.php');
         $classname = 'workshop_'.$allocator.'_allocator';
         call_user_func($classname.'::delete_instance', $workshop->id);
     }
 
-    $evaluators = get_plugin_list('workshopeval');
+    $evaluators = core_component::get_plugin_list('workshopeval');
     foreach ($evaluators as $evaluator => $path) {
         require_once($path.'/lib.php');
         $classname = 'workshop_'.$evaluator.'_evaluation';
@@ -974,7 +974,7 @@ function workshop_cron() {
 function workshop_scale_used($workshopid, $scaleid) {
     global $CFG; // other files included from here
 
-    $strategies = get_plugin_list('workshopform');
+    $strategies = core_component::get_plugin_list('workshopform');
     foreach ($strategies as $strategy => $strategypath) {
         $strategylib = $strategypath . '/lib.php';
         if (is_readable($strategylib)) {
@@ -1007,7 +1007,7 @@ function workshop_scale_used($workshopid, $scaleid) {
 function workshop_scale_used_anywhere($scaleid) {
     global $CFG; // other files included from here
 
-    $strategies = get_plugin_list('workshopform');
+    $strategies = core_component::get_plugin_list('workshopform');
     foreach ($strategies as $strategy => $strategypath) {
         $strategylib = $strategypath . '/lib.php';
         if (is_readable($strategylib)) {
diff --git a/mod/workshop/locallib.php b/mod/workshop/locallib.php
index dcbde8e70a6..c377cf0a00e 100644
--- a/mod/workshop/locallib.php
+++ b/mod/workshop/locallib.php
@@ -212,7 +212,7 @@ class workshop {
      * @return array Array ['string' => 'string'] of localized allocation method names
      */
     public static function installed_allocators() {
-        $installed = get_plugin_list('workshopallocation');
+        $installed = core_component::get_plugin_list('workshopallocation');
         $forms = array();
         foreach ($installed as $allocation => $allocationpath) {
             if (file_exists($allocationpath . '/lib.php')) {
@@ -287,7 +287,7 @@ class workshop {
      * @return array ['string' => 'string']
      */
     public static function available_strategies_list() {
-        $installed = get_plugin_list('workshopform');
+        $installed = core_component::get_plugin_list('workshopform');
         $forms = array();
         foreach ($installed as $strategy => $strategypath) {
             if (file_exists($strategypath . '/lib.php')) {
diff --git a/mod/workshop/settings.php b/mod/workshop/settings.php
index 35cbd08b8af..ff28604d4d9 100644
--- a/mod/workshop/settings.php
+++ b/mod/workshop/settings.php
@@ -61,7 +61,7 @@ if ($ADMIN->fulltree) {
                         get_string('configexamplesmode', 'workshop'), workshop::EXAMPLES_VOLUNTARY, $options));
 
     // include the settings of allocation subplugins
-    $allocators = get_plugin_list('workshopallocation');
+    $allocators = core_component::get_plugin_list('workshopallocation');
     foreach ($allocators as $allocator => $path) {
         if (file_exists($settingsfile = $path . '/settings.php')) {
             $settings->add(new admin_setting_heading('workshopallocationsetting'.$allocator,
@@ -71,7 +71,7 @@ if ($ADMIN->fulltree) {
     }
 
     // include the settings of grading strategy subplugins
-    $strategies = get_plugin_list('workshopform');
+    $strategies = core_component::get_plugin_list('workshopform');
     foreach ($strategies as $strategy => $path) {
         if (file_exists($settingsfile = $path . '/settings.php')) {
             $settings->add(new admin_setting_heading('workshopformsetting'.$strategy,
@@ -81,7 +81,7 @@ if ($ADMIN->fulltree) {
     }
 
     // include the settings of grading evaluation subplugins
-    $evaluations = get_plugin_list('workshopeval');
+    $evaluations = core_component::get_plugin_list('workshopeval');
     foreach ($evaluations as $evaluation => $path) {
         if (file_exists($settingsfile = $path . '/settings.php')) {
             $settings->add(new admin_setting_heading('workshopevalsetting'.$evaluation,
diff --git a/question/engine/bank.php b/question/engine/bank.php
index b329b31409a..b104da2834f 100644
--- a/question/engine/bank.php
+++ b/question/engine/bank.php
@@ -133,7 +133,7 @@ abstract class question_bank {
      * @return bool whether this question type exists.
      */
     public static function qtype_exists($qtypename) {
-        return array_key_exists($qtypename, get_plugin_list('qtype'));
+        return array_key_exists($qtypename, core_component::get_plugin_list('qtype'));
     }
 
     /**
@@ -149,7 +149,7 @@ abstract class question_bank {
      */
     public static function get_all_qtypes() {
         $qtypes = array();
-        foreach (get_plugin_list('qtype') as $plugin => $notused) {
+        foreach (core_component::get_plugin_list('qtype') as $plugin => $notused) {
             try {
                 $qtypes[$plugin] = self::get_qtype($plugin);
             } catch (coding_exception $e) {
diff --git a/question/engine/lib.php b/question/engine/lib.php
index a5e5d12f1b9..80db5b4b46d 100644
--- a/question/engine/lib.php
+++ b/question/engine/lib.php
@@ -225,7 +225,7 @@ abstract class question_engine {
      */
     public static function get_archetypal_behaviours() {
         $archetypes = array();
-        $behaviours = get_plugin_list('qbehaviour');
+        $behaviours = core_component::get_plugin_list('qbehaviour');
         foreach ($behaviours as $behaviour => $notused) {
             if (self::is_behaviour_archetypal($behaviour)) {
                 $archetypes[$behaviour] = self::get_behaviour_name($behaviour);
diff --git a/theme/index.php b/theme/index.php
index 7f6eb61a032..66a400cfb71 100644
--- a/theme/index.php
+++ b/theme/index.php
@@ -152,7 +152,7 @@ if (!empty($CFG->enabledevicedetection) && empty($device)) {
     $table->id = 'adminthemeselector';
     $table->head = array(get_string('theme'), get_string('info'));
 
-    $themes = get_plugin_list('theme');
+    $themes = core_component::get_plugin_list('theme');
 
     foreach ($themes as $themename => $themedir) {
 
diff --git a/user/editadvanced_form.php b/user/editadvanced_form.php
index 1fc2c1e6ea5..ac6a3917eeb 100644
--- a/user/editadvanced_form.php
+++ b/user/editadvanced_form.php
@@ -46,7 +46,7 @@ class user_editadvanced_form extends moodleform {
         $mform->addRule('username', $strrequired, 'required', null, 'client');
         $mform->setType('username', PARAM_RAW);
 
-        $auths = get_plugin_list('auth');
+        $auths = core_component::get_plugin_list('auth');
         $enabled = get_string('pluginenabled', 'core_plugin');
         $disabled = get_string('plugindisabled', 'core_plugin');
         $auth_options = array($enabled=>array(), $disabled=>array());
diff --git a/user/externallib.php b/user/externallib.php
index dbde297f812..7947f2ecfb2 100644
--- a/user/externallib.php
+++ b/user/externallib.php
@@ -112,11 +112,11 @@ class core_user_external extends external_api {
         // If any problems are found then exceptions are thrown with helpful error messages
         $params = self::validate_parameters(self::create_users_parameters(), array('users'=>$users));
 
-        $availableauths  = get_plugin_list('auth');
+        $availableauths  = core_component::get_plugin_list('auth');
         unset($availableauths['mnet']);       // these would need mnethostid too
         unset($availableauths['webservice']); // we do not want new webservice users for now
 
-        $availablethemes = get_plugin_list('theme');
+        $availablethemes = core_component::get_plugin_list('theme');
         $availablelangs  = get_string_manager()->get_list_of_translations();
 
         $transaction = $DB->start_delegated_transaction();
diff --git a/user/filters/lib.php b/user/filters/lib.php
index 6c6a8395be7..19839ba896d 100644
--- a/user/filters/lib.php
+++ b/user/filters/lib.php
@@ -121,7 +121,7 @@ class user_filtering {
             case 'nevermodified': return new user_filter_checkbox('nevermodified', get_string('nevermodified', 'filters'), $advanced, array('timemodified', 'timecreated'), array('timemodified_sck', 'timemodified_eck'));
             case 'cohort':      return new user_filter_cohort($advanced);
             case 'auth':
-                $plugins = get_plugin_list('auth');
+                $plugins = core_component::get_plugin_list('auth');
                 $choices = array();
                 foreach ($plugins as $auth => $unused) {
                     $choices[$auth] = get_string('pluginname', "auth_{$auth}");
diff --git a/user/profile/definelib.php b/user/profile/definelib.php
index c73baf32486..1b87534e104 100644
--- a/user/profile/definelib.php
+++ b/user/profile/definelib.php
@@ -392,7 +392,7 @@ function profile_list_datatypes() {
 
     $datatypes = array();
 
-    $plugins = get_plugin_list('profilefield');
+    $plugins = core_component::get_plugin_list('profilefield');
     foreach ($plugins as $type=>$unused) {
         $datatypes[$type] = get_string('pluginname', 'profilefield_'.$type);
     }