Commit 01889f01 authored by David Mudrák's avatar David Mudrák
Browse files

MDL-43896 admin: Drop support for the $module syntax in version.php

parent e28004e6
......@@ -288,15 +288,24 @@ class core_plugin_manager {
foreach ($plugintypes as $type => $typedir) {
$plugs = core_component::get_plugin_list($type);
foreach ($plugs as $plug => $fullplug) {
$module = new stdClass();
$plugin = new stdClass();
$plugin->version = null;
$module = $plugin;
include($fullplug.'/version.php');
// Check if the legacy $module syntax is still used.
if (!is_object($module) or (!empty((array)$module))) {
debugging('Unsupported $module syntax detected in version.php of the '.$type.'_'.$plug.' plugin.');
$skipcache = true;
}
$this->presentplugins[$type][$plug] = $plugin;
}
}
$cache->set('present', $this->presentplugins);
if (empty($skipcache)) {
$cache->set('present', $this->presentplugins);
}
}
/**
......
......@@ -600,12 +600,18 @@ function upgrade_plugins_modules($startcallback, $endcallback, $verbose) {
throw new plugin_defective_exception($component, 'Missing version.php');
}
// TODO: Support for $module will end with Moodle 2.10 by MDL-43896. Was deprecated for Moodle 2.7 by MDL-43040.
$module = new stdClass();
$plugin = new stdClass();
$plugin->version = null;
$module = $plugin;
require($fullmod .'/version.php'); // Defines $plugin with version etc.
$plugin = clone($module);
// Check if the legacy $module syntax is still used.
if (!is_object($module) or (!empty((array)$module))) {
throw new plugin_defective_exception($component, 'Unsupported $module syntax detected in version.php');
}
// Prepare the record for the {modules} table.
$module = clone($plugin);
unset($module->version);
unset($module->component);
unset($module->dependencies);
......
......@@ -3,7 +3,11 @@ information provided here is intended especially for developers.
=== 3.0 ===
* Function scorm_view_display was renamed to scorm_print_launch to avoid confussion with new function scorm_view.
* Dropped support for the $module in mod/xxx/version.php files (deprecated
since 2.7). All activity modules must use the $plugin syntax now. See
https://docs.moodle.org/dev/version.php for details (MDL-43896).
* Function scorm_view_display was renamed to scorm_print_launch to avoid
confussion with new function scorm_view.
=== 2.9 ===
......
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