MDL-84421 tool_uploadcourse: Stop MUC caching enrol instances
We should not normally cache instances of a class. This can lead to poor design to work around the limitations of PHP Serialization, and could theoretically cause issues with PHP versions changing within a Moodle version.
This commit is contained in:
@@ -177,12 +177,7 @@ class tool_uploadcourse_helper {
|
||||
* @return enrol_plugin[]
|
||||
*/
|
||||
public static function get_enrolment_plugins() {
|
||||
$cache = cache::make('tool_uploadcourse', 'helper');
|
||||
if (($enrol = $cache->get('enrol')) === false) {
|
||||
$enrol = enrol_get_plugins(false);
|
||||
$cache->set('enrol', $enrol);
|
||||
}
|
||||
return $enrol;
|
||||
return enrol_get_plugins(false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user