mirror of
https://github.com/moodle/moodle.git
synced 2025-04-17 06:25:33 +02:00
Keep strings cached in memory during a single page to improve performance
on slow filesystems or bad file caching. (experimental)
This commit is contained in:
parent
d82c1d629d
commit
2b32bdddb9
@ -1043,7 +1043,15 @@ function get_string($identifier, $module="", $a=NULL) {
|
||||
|
||||
function get_string_from_file($identifier, $langfile, $destination) {
|
||||
/// This function is only used from get_string().
|
||||
include ($langfile);
|
||||
|
||||
static $strings; // Keep the strings cached in memory.
|
||||
|
||||
if (empty($strings[$langfile])) {
|
||||
include ($langfile);
|
||||
$strings[$langfile] = $string;
|
||||
} else {
|
||||
$string = &$strings[$langfile];
|
||||
}
|
||||
|
||||
if (!isset ($string[$identifier])) {
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user