rcache: cleanup, upgrade path, config options (MDL-8163)

record cache and caching schemes get a little cleanup, faster
if()s and a nice set of config options. Users who've been using
the internal cache get a nice upgrade too.
This commit is contained in:
martinlanghoff 2007-01-14 23:02:13 +00:00
parent a5855a89bf
commit bb931a61c6
5 changed files with 77 additions and 17 deletions

View file

@ -510,6 +510,20 @@ function xmldb_main_upgrade($oldversion=0) {
/// use get record set to iterate slower
build_context_rel();
}
if ($result && $oldversion < 2007011501) {
if (!empty($CFG->enablerecordcache) && empty($CFG->rcache) &&
// Note: won't force-load these settings into CFG
// we don't need or want cache during the upgrade itself
empty($CFG->cachetype) && empty($CFG->intcachemax)) {
set_config('cachetype', 'internal');
set_config('rcache', true);
set_config('intcachemax', $CFG->enablerecordcache);
unset_config('enablerecordcache');
unset($CFG->enablerecordcache);
}
}
return $result;
}