MDL-49361 lang: Add support for $CFG->customstringmanager

This commit is contained in:
David Mudrák 2015-03-12 21:03:43 +01:00
parent 06122e46fd
commit 9bcb0ba894
2 changed files with 22 additions and 0 deletions

View File

@ -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 {

View File

@ -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 ===