Commit f7b4e716 authored by Penny Leach's avatar Penny Leach
Browse files

made the artefact installer a bit more robust

parent ee75c692
......@@ -40,6 +40,9 @@ define('FORMAT_ARTEFACT_RENDERMETADATA', 'rendermetadata');
function artefact_check_plugin_sanity($pluginname) {
$classname = generate_class_name('artefact', $pluginname);
safe_require('artefact', $pluginname);
if (!is_callable(array($classname, 'get_artefact_types'))) {
throw new InstallationException("Artefact plugin $classname must implement get_artefact_types and doesn't");
}
$types = call_static_method($classname, 'get_artefact_types');
foreach ($types as $type) {
$typeclassname = generate_artefact_class_name($type);
......
......@@ -348,6 +348,9 @@ function upgrade_plugin($upgrade) {
// install artefact types
if ($plugintype == 'artefact') {
if (!is_callable(array($pcname, 'get_artefact_types'))) {
throw new InstallationException("Artefact plugin $pcname must implement get_artefact_types and doesn't");
}
$types = call_static_method($pcname, 'get_artefact_types');
$ph = array();
if (is_array($types)) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment