MDL-22406 CLI installer now switches to core_string_manager() after the lang pack has been fetched

This commit is contained in:
David Mudrak
2010-05-10 14:46:59 +00:00
parent 90150c08ee
commit 7d73574c6f
2 changed files with 11 additions and 1 deletions
+2
View File
@@ -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
View File
@@ -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);