install/includes/cli-core.php
changeset 924 142a29b583f9
parent 857 f3a5a276208c
child 1020 0867b9d38c38
equal deleted inserted replaced
923:9ef3ccac13de 924:142a29b583f9
   599   if ( !$silent )
   599   if ( !$silent )
   600     echo "\n";
   600     echo "\n";
   601   installer_fail($lang->get('cli_err_schema_load'));
   601   installer_fail($lang->get('cli_err_schema_load'));
   602 }
   602 }
   603 
   603 
   604 $wkt = ENANO_ROOT . "/language/{$languages[$lang_id]['dir']}/install/mainpage-default.wkt";
       
   605 if ( !file_exists( $wkt ) )
       
   606 {
       
   607   if ( !$silent )
       
   608     echo "\n";
       
   609   installer_fail($lang->get('cli_err_mainpage_load'));
       
   610 }
       
   611 $wkt = @file_get_contents($wkt);
       
   612 if ( empty($wkt) )
       
   613   return false;
       
   614 
       
   615 $wkt = $db->escape($wkt);
       
   616 
       
   617 $vars = array(
   604 $vars = array(
   618     'TABLE_PREFIX'         => table_prefix,
   605     'TABLE_PREFIX'         => table_prefix,
   619     'SITE_NAME'            => $db->escape($sitename),
   606     'SITE_NAME'            => $db->escape($sitename),
   620     'SITE_DESC'            => $db->escape($sitedesc),
   607     'SITE_DESC'            => $db->escape($sitedesc),
   621     'COPYRIGHT'            => $db->escape($copyright),
   608     'COPYRIGHT'            => $db->escape($copyright),
   627     'ADMIN_PASS_SALT'      => $hmac_secret,
   614     'ADMIN_PASS_SALT'      => $hmac_secret,
   628     'ADMIN_EMAIL'          => $db->escape($email),
   615     'ADMIN_EMAIL'          => $db->escape($email),
   629     'REAL_NAME'            => '', // This has always been stubbed.
   616     'REAL_NAME'            => '', // This has always been stubbed.
   630     'ADMIN_EMBED_PHP'      => strval(AUTH_DISALLOW),
   617     'ADMIN_EMBED_PHP'      => strval(AUTH_DISALLOW),
   631     'UNIX_TIME'            => strval(time()),
   618     'UNIX_TIME'            => strval(time()),
   632     'MAIN_PAGE_CONTENT'    => $wkt,
       
   633     'IP_ADDRESS'           => $_SERVER['REMOTE_ADDR']
   619     'IP_ADDRESS'           => $_SERVER['REMOTE_ADDR']
   634   );
   620   );
   635 
   621 
   636 $sql_parser->assign_vars($vars);
   622 $sql_parser->assign_vars($vars);
   637 $schema = $sql_parser->parse();
   623 $schema = $sql_parser->parse();
   698 require(ENANO_ROOT . '/includes/common.php');
   684 require(ENANO_ROOT . '/includes/common.php');
   699 
   685 
   700 if ( !$silent )
   686 if ( !$silent )
   701   echo parse_shellcolor_string($lang->get('cli_msg_ok')) . "\n";
   687   echo parse_shellcolor_string($lang->get('cli_msg_ok')) . "\n";
   702 
   688 
       
   689 $_POST['username'] =& $user;
       
   690 $_POST['default_content_type'] = ( isset($start_with) ) ? $start_with : 'blank';
       
   691 
   703 run_installer_stage('importlang', 'importing_language', 'stg_language_setup', $lang->get('install_stg_importlang_body'));
   692 run_installer_stage('importlang', 'importing_language', 'stg_language_setup', $lang->get('install_stg_importlang_body'));
       
   693 run_installer_stage('importcontent', 'importing_content', 'stg_add_content', $lang->get('install_stg_importcontent_body'));
   704 run_installer_stage('initlogs', 'initting_logs', 'stg_init_logs', $lang->get('install_stg_initlogs_body'));
   694 run_installer_stage('initlogs', 'initting_logs', 'stg_init_logs', $lang->get('install_stg_initlogs_body'));
   705 run_installer_stage('cleanup', 'cleaning_up', 'stg_aes_cleanup', $lang->get('install_stg_cleanup_body'), false);
   695 run_installer_stage('cleanup', 'cleaning_up', 'stg_aes_cleanup', $lang->get('install_stg_cleanup_body'), false);
   706 run_installer_stage('buildindex', 'initting_index', 'stg_build_index', $lang->get('install_stg_buildindex_body'));
   696 run_installer_stage('buildindex', 'initting_index', 'stg_build_index', $lang->get('install_stg_buildindex_body'));
   707 run_installer_stage('renameconfig', 'renaming_config', 'stg_rename_config', $lang->get('install_stg_rename_body', array('mainpage_link' => scriptPath . '/index.php')));
   697 run_installer_stage('renameconfig', 'renaming_config', 'stg_rename_config', $lang->get('install_stg_rename_body', array('mainpage_link' => scriptPath . '/index.php')));
   708 
   698