Commit f53fde9f authored by David Mudrak's avatar David Mudrak
Browse files

MDL-22015 core_string_manager cache can be disabled by setting $CFG->disablelangdiskcache

parent 9b3af74c
......@@ -371,6 +371,9 @@ $CFG->admin = 'admin';
// Prevent theme caching
// $CFG->themerev = -1; // NOT FOR PRODUCTION SERVERS!
//
// Prevent core_string_manager on-disk cache
// $CFG->disablelangdiskcache = true; // NOT FOR PRODUCTION SERVERS!
//
// When working with production data on test servers, no emails should ever be send to real users
// $CFG->noemailever = true; // NOT FOR PRODUCTION SERVERS!
//
......
......@@ -5934,7 +5934,7 @@ class core_string_manager implements string_manager {
}
// try on-disk cache then
if (file_exists($this->cacheroot . "/$lang/$component")) {
if (empty($CFG->disablelangdiskcache) and file_exists($this->cacheroot . "/$lang/$component")) {
$this->countdiskcache++;
eval('$this->cache[$lang][$component] = ' . file_get_contents($this->cacheroot . "/$lang/$component") . ';');
return $this->cache[$lang][$component];
......@@ -6015,8 +6015,10 @@ class core_string_manager implements string_manager {
// now we have a list of strings from all possible sources. put it into both in-memory and on-disk
// caches so we do not need to do all this merging and dependecies resolving again
$this->cache[$lang][$component] = $string;
check_dir_exists($this->cacheroot . '/' . $lang, true, true);
file_put_contents($this->cacheroot . "/$lang/$component", var_export($string, true));
if (empty($CFG->disablelangdiskcache)) {
check_dir_exists($this->cacheroot . '/' . $lang, true, true);
file_put_contents($this->cacheroot . "/$lang/$component", var_export($string, true));
}
return $string;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment