MDL-13661 - fixing incorrect use of array_shift

This commit is contained in:
skodak
2008-02-25 20:21:18 +00:00
parent a4166d5966
commit 3dd102788f
+6 -2
View File
@@ -1473,7 +1473,9 @@ function format_text($text, $format=FORMAT_MOODLE, $options=NULL, $courseid=NULL
if ($oldcacheitem->timemodified >= $time) {
if (defined('FULLME') and FULLME == 'cron') {
if (count($croncache) > 150) {
array_shift($croncache);
reset($croncache);
$key = key($croncache);
unset($croncache[$key]);
}
$croncache[$md5key] = $oldcacheitem->formattedtext;
}
@@ -1560,7 +1562,9 @@ function format_text($text, $format=FORMAT_MOODLE, $options=NULL, $courseid=NULL
if (defined('FULLME') and FULLME == 'cron') {
// special static cron cache - no need to store it in db if its not already there
if (count($croncache) > 150) {
array_shift($croncache);
reset($croncache);
$key = key($croncache);
unset($croncache[$key]);
}
$croncache[$md5key] = $text;
return $text;