From c8d51449f7bdb045f7d273f796e18a821d48b4ad Mon Sep 17 00:00:00 2001 From: skodak Date: Mon, 25 Feb 2008 15:16:21 +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 e2f6b3c05d7..e0621b2c9a7 100644 --- a/lib/dmllib.php +++ b/lib/dmllib.php @@ -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 {