# HG changeset patch # User Dan # Date 1194384163 18000 # Node ID c671f3bb8aed2b2da2e71d80f3ab42be394b9e26 # Parent f0149a27df5f9ab75790b2bb7cc172cca0b24713 Trying to get lang import to work in the installer; it's not working ATM - cache file is generated with lang_id = 0. Syncing to Nighthawk. diff -r f0149a27df5f -r c671f3bb8aed includes/functions.php --- a/includes/functions.php Tue Nov 06 13:35:40 2007 -0500 +++ b/includes/functions.php Tue Nov 06 16:22:43 2007 -0500 @@ -3206,14 +3206,18 @@ $db->_die('functions.php - installing language'); $lang_id = $db->insert_id(); - if ( empty($lang_id) ) - return false; + if ( empty($lang_id) || $lang_id == 0 ) + { + $db->_die('functions.php - invalid returned lang_id'); + } // Do we also need to install a language file? if ( is_string($lang_file) && file_exists($lang_file) ) { $lang = new Language($lang_id); $lang->import($lang_file); + $lang->fetch(false); + $lang->regen_caches(); } else if ( is_string($lang_file) && !file_exists($lang_file) ) { diff -r f0149a27df5f -r c671f3bb8aed includes/lang.php --- a/includes/lang.php Tue Nov 06 13:35:40 2007 -0500 +++ b/includes/lang.php Tue Nov 06 16:22:43 2007 -0500 @@ -154,7 +154,8 @@ } else { - $db->_die('lang.php - No strings for language ' . $this->lang_code); + if ( !defined('ENANO_ALLOW_LOAD_NOLANG') ) + $db->_die('lang.php - No strings for language ' . $this->lang_code); } } } @@ -215,6 +216,9 @@ if ( !file_exists($file) ) $db->_die('lang.php - can\'t import language file: string file doesn\'t exist'); + if ( $this->lang_id == 0 ) + $db->_die('lang.php - BUG: trying to perform import when $lang->lang_id == 0'); + $contents = trim(@file_get_contents($file)); if ( empty($contents) ) diff -r f0149a27df5f -r c671f3bb8aed install.php --- a/install.php Tue Nov 06 13:35:40 2007 -0500 +++ b/install.php Tue Nov 06 16:22:43 2007 -0500 @@ -586,9 +586,6 @@ $lang_file = ENANO_ROOT . "/language/english/enano.json"; install_language("eng", "English", "English", $lang_file); - $lang = new Language('eng'); - $lang->import($lang_file); - return true; }