Merge branch 'MDL-49361-master-stringman' of git://github.com/mudrd8mz/moodle

This commit is contained in:
Eloy Lafuente (stronk7) 2015-03-17 12:00:29 +01:00
commit 536cf8c298
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

@ -25,6 +25,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 ===