// database $h = new Hotaru('install'); // must come before language inclusion require_once INSTALL . 'install_language.php'; // language file for install $db = init_database(); $cage = init_inspekt_cage(); $step = $cage->get->getInt('step'); // Installation steps. switch ($step) { case 1: installation_welcome(); // "Welcome to Hotaru CMS. break; case 2: database_setup(); // DB name, user, password, prefix... break; case 3: database_creation(); // Creates the database tables break; case 4: register_admin(); // Username and password for Admin user... break; case 5: installation_complete(); // Delete "install" folder. Visit your site" break; default:
//$xerte_toolkits_site->database_location = sys_get_temp_dir() . '/xerte.sqlite'; $xerte_toolkits_site->database_type = 'mysql'; if (file_exists(dirname(__FILE__) . '/database.php')) { require_once dirname(__FILE__) . '/database.php'; } require_once dirname(__FILE__) . '/website_code/php/database_library.php'; $ok = database_is_setup($xerte_toolkits_site); if (!$ok) { if ($xerte_toolkits_site->database_type == 'mysql' && is_dir(dirname(__FILE__) . '/setup')) { header("Location: {$_SERVER['REQUEST_URI']}setup/"); exit(0); } /* run the magical sqlite auto-installer */ if ($xerte_toolkits_site->database_type == 'sqlite') { require_once dirname(__FILE__) . '/website_code/php/database_library_sqlite.php'; $ok = database_setup($xerte_toolkits_site->database_location); } } if (!$ok) { die("Database setup failed"); } /* test database access */ if (!database_connect($xerte_toolkits_site)) { die("database.php isn't correctly configured; or we cannot connect to database"); } $row = db_query_one("SELECT * FROM {$xerte_toolkits_site->database_table_prefix}sitedetails"); if ($row['integration_config_path'] != "") { require_once $row['integration_config_path']; } unset($row['integration_config_path']); foreach ($row as $key => $value) {
switch ($step) { case 0: // Show the choice of upgrade or install screen installation_welcome($h, $settings_file_exists); // Welcome to Hotaru CMS. break; case 1: if ($action == 'upgrade') { $old_version = $h->miscdata('hotaru_version'); upgrade_check($h, $old_version, true); } else { // Tell user to setup database if ($h->cage->get->getAlpha('type') == 'manual') { database_setup_manual($h); } else { database_setup($h, $settings_file_exists); } } break; case 2: if ($action == 'upgrade') { $old_version = $h->miscdata('hotaru_version'); do_upgrade($h, $old_version); upgrade_database($h); } else { $db = init_database(); // Create the database tables database_tables_creation($h); } break; case 3: