MDL-40220 use new core_component::get_plugin_types()

This commit is contained in:
Petr Škoda 2013-07-16 22:31:48 +02:00
parent 55fcd9323e
commit 46f6f7f224
14 changed files with 21 additions and 21 deletions

View File

@ -105,7 +105,7 @@ function tool_dbtransfer_rebuild_target_log_actions(moodle_database $target, pro
try {
$DB->delete_records('log_display', array('component'=>'moodle'));
log_update_descriptions('moodle');
$plugintypes = get_plugin_types();
$plugintypes = core_component::get_plugin_types();
foreach ($plugintypes as $type => $location) {
$plugs = get_plugin_list($type);
foreach ($plugs as $plug => $fullplug) {

View File

@ -182,7 +182,7 @@ class tool_installaddon_installer {
public function get_plugintype_root($plugintype) {
$plugintypepath = null;
foreach (get_plugin_types() as $type => $fullpath) {
foreach (core_component::get_plugin_types() as $type => $fullpath) {
if ($type === $plugintype) {
$plugintypepath = $fullpath;
break;

View File

@ -563,7 +563,7 @@ class tool_installaddon_validator {
$plugintypepath = null;
foreach (get_plugin_types() as $type => $fullpath) {
foreach (core_component::get_plugin_types() as $type => $fullpath) {
if ($type === $plugintype) {
$plugintypepath = $fullpath;
break;

View File

@ -118,7 +118,7 @@ abstract class restore_plugin {
static public function get_restore_decode_contents($plugintype) {
$decodecontents = array();
// Check the requested plugintype is a valid one
if (!array_key_exists($plugintype, get_plugin_types($plugintype))) {
if (!array_key_exists($plugintype, core_component::get_plugin_types($plugintype))) {
throw new backup_step_exception('incorrect_plugin_type', $plugintype);
}
// Check the base plugin class exists

View File

@ -125,7 +125,7 @@ abstract class backup_structure_step extends backup_step {
/**
* Add plugin structure to any element in the structure backup tree
*
* @param string $plugintype type of plugin as defined by get_plugin_types()
* @param string $plugintype type of plugin as defined by core_component::get_plugin_types()
* @param backup_nested_element $element element in the structure backup tree that
* we are going to add plugin information to
* @param bool $multiple to define if multiple plugins can produce information
@ -136,7 +136,7 @@ abstract class backup_structure_step extends backup_step {
global $CFG;
// Check the requested plugintype is a valid one
if (!array_key_exists($plugintype, get_plugin_types($plugintype))) {
if (!array_key_exists($plugintype, core_component::get_plugin_types($plugintype))) {
throw new backup_step_exception('incorrect_plugin_type', $plugintype);
}

View File

@ -289,7 +289,7 @@ abstract class restore_structure_step extends restore_step {
/**
* Add plugin structure to any element in the structure restore tree
*
* @param string $plugintype type of plugin as defined by get_plugin_types()
* @param string $plugintype type of plugin as defined by core_component::get_plugin_types()
* @param restore_path_element $element element in the structure restore tree that
* we are going to add plugin information to
*/
@ -298,7 +298,7 @@ abstract class restore_structure_step extends restore_step {
global $CFG;
// Check the requested plugintype is a valid one
if (!array_key_exists($plugintype, get_plugin_types($plugintype))) {
if (!array_key_exists($plugintype, core_component::get_plugin_types($plugintype))) {
throw new restore_step_exception('incorrect_plugin_type', $plugintype);
}

2
cache/locallib.php vendored
View File

@ -520,7 +520,7 @@ class cache_config_writer extends cache_config {
}
if (!$coreonly) {
$plugintypes = get_plugin_types();
$plugintypes = core_component::get_plugin_types();
foreach ($plugintypes as $type => $location) {
$plugins = get_plugin_list_with_file($type, 'db/caches.php');
foreach ($plugins as $plugin => $filepath) {

View File

@ -494,8 +494,8 @@ function get_db_directories() {
/// First, the main one (lib/db)
$dbdirs[] = $CFG->libdir.'/db';
/// Then, all the ones defined by get_plugin_types()
$plugintypes = get_plugin_types();
/// 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)) {
foreach ($plugins as $plugin => $plugindir) {

View File

@ -774,7 +774,7 @@ class theme_config {
// get all plugin sheets
$excludes = $this->resolve_excludes('plugins_exclude_sheets');
if ($excludes !== true) {
foreach (get_plugin_types() as $type=>$unused) {
foreach (core_component::get_plugin_types() as $type=>$unused) {
if ($type === 'theme' || (!empty($excludes[$type]) and $excludes[$type] === true)) {
continue;
}

View File

@ -456,7 +456,7 @@ class phpunit_util extends testing_util {
$suites = '';
$plugintypes = get_plugin_types();
$plugintypes = core_component::get_plugin_types();
ksort($plugintypes);
foreach ($plugintypes as $type=>$unused) {
$plugs = get_plugin_list($type);

View File

@ -97,14 +97,14 @@ class plugin_manager {
}
/**
* Returns the result of {@link get_plugin_types()} ordered for humans
* Returns the result of {@link core_component::get_plugin_types()} ordered for humans
*
* @see self::reorder_plugin_types()
* @param bool $fullpaths false means relative paths from dirroot
* @return array (string)name => (string)location
*/
public function get_plugin_types($fullpaths = true) {
return $this->reorder_plugin_types(get_plugin_types($fullpaths));
return $this->reorder_plugin_types(core_component::get_plugin_types($fullpaths));
}
/**
@ -882,7 +882,7 @@ class plugin_manager {
/**
* Reorders plugin types into a sequence to be displayed
*
* For technical reasons, plugin types returned by {@link get_plugin_types()} are
* For technical reasons, plugin types returned by {@link core_component::get_plugin_types()} are
* in a certain order that does not need to fit the expected order for the display.
* Particularly, activity modules should be displayed first as they represent the
* real heart of Moodle. They should be followed by other plugin types that are
@ -1973,7 +1973,7 @@ class available_update_deployer {
*/
public function plugin_external_source(available_update_info $info) {
$paths = get_plugin_types(true);
$paths = core_component::get_plugin_types();
list($plugintype, $pluginname) = normalize_component($info->component);
$pluginroot = $paths[$plugintype].'/'.$pluginname;
@ -2031,7 +2031,7 @@ class available_update_deployer {
throw new coding_exception('Illegal method call - deployer not initialized.');
}
$pluginrootpaths = get_plugin_types(true);
$pluginrootpaths = core_component::get_plugin_types();
list($plugintype, $pluginname) = normalize_component($info->component);

View File

@ -63,7 +63,7 @@ class tests_finder {
private static function get_all_plugins_with_tests($testtype) {
$pluginswithtests = array();
$plugintypes = get_plugin_types();
$plugintypes = core_component::get_plugin_types();
ksort($plugintypes);
foreach ($plugintypes as $type => $unused) {
$plugs = get_plugin_list($type);

View File

@ -700,7 +700,7 @@ abstract class testing_util {
}
// now the rest of plugins
$plugintypes = get_plugin_types();
$plugintypes = core_component::get_plugin_types();
unset($plugintypes['mod']);
ksort($plugintypes);
foreach ($plugintypes as $type => $unused) {

View File

@ -1583,7 +1583,7 @@ function upgrade_noncore($verbose) {
// upgrade all plugins types
try {
$plugintypes = get_plugin_types();
$plugintypes = core_component::get_plugin_types();
foreach ($plugintypes as $type=>$location) {
upgrade_plugins($type, 'print_upgrade_part_start', 'print_upgrade_part_end', $verbose);
}