mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-41437 rework plugin_manager caching and version info in blocks and modules
This patch includes: * version column removed from modules table, now using standard config, this allows decimal version for modules * version column removed from block table, now using standard config, this allows decimal version for blocks * module version.php can safely use $plugins instead of module * new plugin_manager bulk caching, this should help with MUC performance when logged in as admin * all missing plugins are now in plugin overview (previously only blocks and modules) * simplified code and improved coding style * reworked plugin_manager unit tests - now using real plugins instead of mocks * unit tests now fail if any plugin does not contain proper version.php file * allow uninstall of deleted filters
This commit is contained in:
parent
81881cb9d6
commit
bde002b81a
50 changed files with 1601 additions and 1940 deletions
|
@ -29,6 +29,7 @@ if (empty($CFG->enableportfolios)) {
|
|||
print_error('disabled', 'portfolio');
|
||||
}
|
||||
|
||||
require_once($CFG->libdir . '/pluginlib.php');
|
||||
require_once($CFG->libdir . '/portfoliolib.php');
|
||||
require_once($CFG->libdir . '/portfolio/forms.php');
|
||||
|
||||
|
@ -57,9 +58,6 @@ $display = true; // set this to false in the conditions to stop processing
|
|||
|
||||
require_login($course, false);
|
||||
|
||||
// Purge all caches related to portfolio administration.
|
||||
cache::make('core', 'plugininfo_portfolio')->purge();
|
||||
|
||||
$PAGE->set_url($url);
|
||||
$PAGE->set_context(context_user::instance($user->id));
|
||||
$PAGE->set_title("$course->fullname: $fullname: $strportfolios");
|
||||
|
@ -84,6 +82,7 @@ if (!empty($config)) {
|
|||
$success = $instance->set_user_config($fromform, $USER->id);
|
||||
//$success = $success && $instance->save();
|
||||
if ($success) {
|
||||
plugin_manager::reset_caches();
|
||||
redirect($baseurl, get_string('instancesaved', 'portfolio'), 3);
|
||||
} else {
|
||||
print_error('instancenotsaved', 'portfolio', $baseurl);
|
||||
|
@ -100,6 +99,7 @@ if (!empty($config)) {
|
|||
} else if (!empty($hide)) {
|
||||
$instance = portfolio_instance($hide);
|
||||
$instance->set_user_config(array('visible' => !$instance->get_user_config('visible', $USER->id)), $USER->id);
|
||||
plugin_manager::reset_caches();
|
||||
}
|
||||
|
||||
if ($display) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue