EOF; $html_footer = <<<EOF <div class="footer"> <h6><a href="http://www.33hao.com" target="_blank">程序来源于 bbs.33hao.com</a></h6> </div> EOF; require './include/function.php'; if (!in_array($_GET['step'], array(1, 2, 3, 4, 5))) { $_GET['step'] = 0; } switch ($_GET['step']) { case 1: require './include/var.php'; env_check($env_items); dirfile_check($dirfile_items); function_check($func_items); break; case 3: $install_error = ''; $install_recover = ''; $demo_data = file_exists('./data/utf8_add.sql') ? true : false; step3($install_error, $install_recover); break; case 4: step4(); break; case 5: $sitepath = strtolower(substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['PHP_SELF'], '/'))); $sitepath = str_replace('/shop/install', "", $sitepath); $auto_site_url = strtolower('http://' . $_SERVER['HTTP_HOST'] . $sitepath);
$str = str_replace('$config[\'admin_folder\']=\'admin\';', '$config[\'admin_folder\']=\'' . $admin_folder . '\';', $str); file_put_contents($ConfigPath, $str); rename('../application/controllers/admin', '../application/controllers/' . $admin_folder); $sql = 'update lee_user set username="******",password="******",salt="' . $salt . '" where id=1'; mysql_query($sql); @fopen("../data/install.lock", 'w'); $error = $lang['installok'] . '<br><a href="' . $base_url . '" target="_blank">' . $lang['frontmana'] . $base_url . '</a><br><a href="' . $base_url . 'index.php?/' . $admin_folder . '/login" target="_blank">' . $lang['blackmana'] . $base_url . 'index.php?/' . $admin_folder . '/login</a>'; $step = 2; } } } else { $error = $lang['alldatabaseinfo']; } } else { $dirfile = array(0 => array('path' => '../data', 'type' => 'dir'), 1 => array('path' => '../data/attachment', 'type' => 'dir'), 2 => array('path' => '../data/backup', 'type' => 'dir'), 3 => array('path' => '../data/bak', 'type' => 'dir'), 4 => array('path' => '../data/cache', 'type' => 'dir'), 5 => array('path' => '../data/sitemap', 'type' => 'dir'), 6 => array('path' => '../application/controllers/admin', 'type' => 'dir'), 7 => array('path' => '../application/config/database.php', 'type' => 'file'), 8 => array('path' => '../application/config/config.php', 'type' => 'file'), 9 => array('path' => '../data/template', 'type' => 'dir')); $dirfile = dirfile_check($dirfile); } $url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']; $url = substr($url, 0, -17); function dirfile_check($dirfile_items) { foreach ($dirfile_items as $key => $item) { $item_path = $item['path']; if ($item['type'] == 'dir') { if (!dir_writeable(FCPATH . $item_path)) { if (is_dir(FCPATH . $item_path)) { $dirfile_items[$key]['status'] = 0; $dirfile_items[$key]['current'] = '+r'; } else { $dirfile_items[$key]['status'] = -1; $dirfile_items[$key]['current'] = 'nodir';