From 6b7af6872017ba096a0adeb5ec6dbf00383b59c8 Mon Sep 17 00:00:00 2001 From: skodak Date: Mon, 25 Feb 2008 15:15:36 +0000 Subject: [PATCH] MDL-13237, MDL-13661 - fixing rcache regression, sorry :-(; merged from MOODLE_19_STABLE --- lib/dmllib.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/dmllib.php b/lib/dmllib.php index 9f5e236ac8..eae308b0d4 100644 --- a/lib/dmllib.php +++ b/lib/dmllib.php @@ -2536,7 +2536,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 { -- 2.39.5