MDL-22406 CLI installer now switches to core_string_manager() after the lang pack has been fetched
This commit is contained in:
@@ -333,7 +333,9 @@ if ($CFG->lang != 'en') {
|
||||
}
|
||||
}
|
||||
|
||||
// switch the string_manager instance to stop using install/lang/
|
||||
$CFG->early_install_lang = false;
|
||||
get_string_manager(true);
|
||||
|
||||
// ask for db type - show only drivers available
|
||||
if ($interactive) {
|
||||
|
||||
+9
-1
@@ -5706,13 +5706,21 @@ function get_parent_language($lang=null) {
|
||||
|
||||
/**
|
||||
* Returns current string_manager instance.
|
||||
*
|
||||
* The param $forcereload is needed for CLI installer only where the string_manager instance
|
||||
* must be replaced during the install.php script life time.
|
||||
*
|
||||
* @param bool $forcereload shall the singleton be released and new instance created instead?
|
||||
* @return string_manager
|
||||
*/
|
||||
function get_string_manager() {
|
||||
function get_string_manager($forcereload=false) {
|
||||
global $CFG;
|
||||
|
||||
static $singleton = null;
|
||||
|
||||
if ($forcereload) {
|
||||
$singleton = null;
|
||||
}
|
||||
if ($singleton === null) {
|
||||
if (empty($CFG->early_install_lang)) {
|
||||
$singleton = new core_string_manager($CFG->langotherroot, $CFG->langlocalroot);
|
||||
|
||||
Reference in New Issue
Block a user