Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
integration
prechecker
Commits
f53fde9f
Commit
f53fde9f
authored
May 16, 2010
by
David Mudrak
Browse files
MDL-22015 core_string_manager cache can be disabled by setting $CFG->disablelangdiskcache
parent
9b3af74c
Changes
2
Hide whitespace changes
Inline
Side-by-side
config-dist.php
View file @
f53fde9f
...
...
@@ -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!
//
...
...
lib/moodlelib.php
View file @
f53fde9f
...
...
@@ -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
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment