Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
moodle
moodle
Commits
ea7d4b09
Commit
ea7d4b09
authored
Apr 16, 2012
by
Petr Skoda
Browse files
MDL-32377 do not store incomplete component strings without local packs in on-disk string cache
parent
668a499d
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/moodlelib.php
View file @
ea7d4b09
...
...
@@ -6293,7 +6293,7 @@ class core_string_manager implements string_manager {
$component
=
$plugintype
.
'_'
.
$pluginname
;
}
if
(
!
$disablecache
)
{
if
(
!
$disablecache
and
!
$disablelocal
)
{
// try in-memory cache first
if
(
isset
(
$this
->
cache
[
$lang
][
$component
]))
{
$this
->
countmemcache
++
;
...
...
@@ -6384,12 +6384,14 @@ class core_string_manager implements string_manager {
// we do not want any extra strings from other languages - everything must be in en lang pack
$string
=
array_intersect_key
(
$string
,
$originalkeys
);
// 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 dependencies resolving again
$this
->
cache
[
$lang
][
$component
]
=
$string
;
if
(
$this
->
usediskcache
)
{
check_dir_exists
(
"
$this->cacheroot
/
$lang
"
);
file_put_contents
(
"
$this->cacheroot
/
$lang
/
$component
.php"
,
"<?php
\$
this->cache['
$lang
']['
$component
'] = "
.
var_export
(
$string
,
true
)
.
";"
);
if
(
!
$disablelocal
)
{
// 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 dependencies resolving again
$this
->
cache
[
$lang
][
$component
]
=
$string
;
if
(
$this
->
usediskcache
)
{
check_dir_exists
(
"
$this->cacheroot
/
$lang
"
);
file_put_contents
(
"
$this->cacheroot
/
$lang
/
$component
.php"
,
"<?php
\$
this->cache['
$lang
']['
$component
'] = "
.
var_export
(
$string
,
true
)
.
";"
);
}
}
return
$string
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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