private function get_install_path($type)
{
global $CFG;
if ($this->moodlerelease >= 2.6) {
$types = \core_component::get_plugin_types();
} else {
if ($this->moodlerelease >= 2.0) {
$types = get_plugin_types();
} else {
// Moodle 1.9 does not give us a way to determine plugin
// installation paths.
$types = array();
}
}
if (empty($types) || !array_key_exists($type, $types)) {
// Either the moodle version is lower than 2.0, in which case we
// don't have a reliable way of determining the install path, or the
// plugin is of an unknown type.
//
// Let's fall back to make our best guess.
return $CFG->dirroot . '/' . $type;
}
return $types[$type];
}