MDL-13237, MDL-13661 - fixing rcache regression, sorry :-(; merged from MOODLE_19_STABLE

This commit is contained in:
skodak
2008-02-25 15:16:21 +00:00
parent b2fb1d4096
commit c8d51449f7
+4 -1
View File
@@ -2328,7 +2328,10 @@ function rcache_set($table, $id, $rec) {
$rcache->data[$table] = array();
}
if (!isset($rcache->data[$table][$id]) and count($rcache->data[$table]) > $CFG->intcachemax) {
array_shift($rcache->data[$table]);
// release oldes record
reset($rcache->data[$table]);
$key = key($rcache->data[$table]);
unset($rcache->data[$table][$key]);
}
$rcache->data[$table][$id] = clone($rec);
} else {