MDL-45678 cache: renamed new cache and better comments

This commit is contained in:
Sam Hemelryk 2014-07-08 09:52:41 +12:00
parent 207891d791
commit 03ecddb440
4 changed files with 7 additions and 6 deletions

View File

@ -46,7 +46,7 @@ $string['cachedef_coursemodinfo'] = 'Accumulated information about modules and s
$string['cachedef_databasemeta'] = 'Database meta information';
$string['cachedef_eventinvalidation'] = 'Event invalidation';
$string['cachedef_externalbadges'] = 'External badges for particular user';
$string['cachedef_get_suspended_userids'] = 'List of suspended user identifiers per course';
$string['cachedef_suspended_userids'] = 'List of suspended users per course';
$string['cachedef_gradecondition'] = 'User grades cached for evaluating conditional availability';
$string['cachedef_groupdata'] = 'Course group information';
$string['cachedef_htmlpurifier'] = 'HTML Purifier - cleaned content';

View File

@ -7460,7 +7460,7 @@ function extract_suspended_users($context, &$users, $ignoreusers=array()) {
* or enrolment has expired or not started.
*
* @param context $context context in which user enrolment is checked.
* @param bool $context Enable or disable (default) the request cache
* @param bool $usecache Enable or disable (default) the request cache
* @return array list of suspended user id's.
*/
function get_suspended_userids(context $context, $usecache = false) {
@ -7468,7 +7468,7 @@ function get_suspended_userids(context $context, $usecache = false) {
// Check the cache first for performance reasons if enabled.
if ($usecache) {
$cache = cache::make('core', 'get_suspended_userids');
$cache = cache::make('core', 'suspended_userids');
$susers = $cache->get($context->id);
if ($susers !== false) {
return $susers;

View File

@ -223,8 +223,9 @@ $definitions = array(
'simpledata' => true
),
// For the function get_suspended_userids() in core_access.
'get_suspended_userids' => array(
// Caches suspended userids by course.
// The key is the courseid, the value is an array of user ids.
'suspended_userids' => array(
'mode' => cache_store::MODE_REQUEST,
'simplekeys' => true,
'simpledata' => true,

View File

@ -1407,7 +1407,7 @@ abstract class enrol_plugin {
context_course::instance($instance->courseid)->mark_dirty(); // reset enrol caches
// Invalidate core_access cache for get_suspended_userids.
cache_helper::invalidate_by_definition('core', 'get_suspended_userids', array(), array($instance->courseid));
cache_helper::invalidate_by_definition('core', 'suspended_userids', array(), array($instance->courseid));
// Trigger event.
$event = \core\event\user_enrolment_updated::create(