install/schemas/upgrade/migration/1.0-1.1.php
changeset 377 bb3e6c3bd4f4
child 418 322fa0c91303
equal deleted inserted replaced
376:66732bd4532c 377:bb3e6c3bd4f4
       
     1 <?php
       
     2 
       
     3 function MIGRATE()
       
     4 {
       
     5   global $languages;
       
     6   global $db, $dbdriver;
       
     7   
       
     8   // Database upgrade
       
     9   try
       
    10   {
       
    11     $sql_parser = new SQL_Parser('install/schemas/upgrade/migration/1.0-1.1-' . $dbdriver . '.sql');
       
    12   }
       
    13   catch ( Exception $e )
       
    14   {
       
    15     die("<pre>$e</pre>");
       
    16   }
       
    17   
       
    18   $sql_parser->assign_vars(array(
       
    19       'TABLE_PREFIX' => table_prefix
       
    20     ));
       
    21   
       
    22   $sql_list = $sql_parser->parse();
       
    23   foreach ( $sql_list as $sql )
       
    24   {
       
    25     if ( !$db->sql_query($sql) )
       
    26       $db->_die();
       
    27   }
       
    28   
       
    29   // Install default language
       
    30   $lang_id = 'eng';
       
    31   $lang_data =& $languages[$lang_id];
       
    32   $lang_dir = ENANO_ROOT . "/language/{$lang_data['dir']}/";
       
    33   // function install_language($lang_code, $lang_name_neutral, $lang_name_local, $lang_file = false)
       
    34   install_language($lang_id, $lang_data['name_eng'], $lang_data['name'], $lang_dir . 'core.json');
       
    35   $lang_local = new Language($lang_id);
       
    36   $lang_local->import($lang_dir . "tools.json");
       
    37   $lang_local->import($lang_dir . "user.json");
       
    38   $lang_local->import($lang_dir . "admin.json");
       
    39   
       
    40   setConfig('enano_version', installer_enano_version());
       
    41   
       
    42   return true;
       
    43 }
       
    44