mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
MDL-49361 lang: Add support for $CFG->customstringmanager
This commit is contained in:
parent
06122e46fd
commit
9bcb0ba894
@ -6842,6 +6842,26 @@ function get_string_manager($forcereload=false) {
|
||||
$translist = explode(',', $CFG->langlist);
|
||||
}
|
||||
|
||||
if (!empty($CFG->config_php_settings['customstringmanager'])) {
|
||||
$classname = $CFG->config_php_settings['customstringmanager'];
|
||||
|
||||
if (class_exists($classname)) {
|
||||
$implements = class_implements($classname);
|
||||
|
||||
if (isset($implements['core_string_manager'])) {
|
||||
$singleton = new $classname($CFG->langotherroot, $CFG->langlocalroot, $translist);
|
||||
return $singleton;
|
||||
|
||||
} else {
|
||||
debugging('Unable to instantiate custom string manager: class '.$classname.
|
||||
' does not implement the core_string_manager interface.');
|
||||
}
|
||||
|
||||
} else {
|
||||
debugging('Unable to instantiate custom string manager: class '.$classname.' can not be found.');
|
||||
}
|
||||
}
|
||||
|
||||
$singleton = new core_string_manager_standard($CFG->langotherroot, $CFG->langlocalroot, $translist);
|
||||
|
||||
} else {
|
||||
|
@ -24,6 +24,8 @@ information provided here is intended especially for developers.
|
||||
and sql_reader which use iterators to be more memory efficient.
|
||||
* $CFG->enabletgzbackups setting has been removed as now backups are stored internally using .tar.gz format by default, you can
|
||||
set $CFG->usezipbackups to store them in zip format. This does not affect the restore process, which continues accepting both.
|
||||
* Added support for custom string manager implementations via $CFG->customstringmanager
|
||||
directive in the config.php. See MDL-49361 for details.
|
||||
|
||||
=== 2.8 ===
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user