$tpl->assign('db_driver', $db_driver); $tpl->assign('db_server', $db_server); $tpl->assign('db_name', $db_name); $tpl->assign('db_user', $db_user); $tpl->assign('db_pass', $db_pass); $tpl->assign('failed', true); $tpl->assign('result', $result); $tpl->assign('config_path', realpath(APP_PATH . "/framework.config.php")); $tpl->assign('template', 'steps/step_config_file.tpl.php'); } break; // Initialize the database // Initialize the database case STEP_INIT_DB: // [TODO] Add current user to patcher/upgrade authorized IPs if (CerberusInstaller::isDatabaseEmpty()) { // install $patchMgr = DevblocksPlatform::getPatchService(); // [JAS]: Run our overloaded container for the platform $patchMgr->registerPatchContainer(new PlatformPatchContainer()); // Clean script if (!$patchMgr->run()) { // [TODO] Show more info on the error $tpl->assign('template', 'steps/step_init_db.tpl.php'); } else { // success // Read in plugin information from the filesystem to the database DevblocksPlatform::readPlugins(); /* * [TODO] This possibly needs to only start with core, because as soon * as we add back another feature with licensing we'll have installer
// Test the given settings, bypass platform initially include_once DEVBLOCKS_PATH . "libs/adodb5/adodb.inc.php"; $ADODB_CACHE_DIR = APP_TEMP_PATH . "/cache"; @($db =& ADONewConnection($db_driver)); @$db->Connect($db_server, $db_user, $db_pass, $db_name); $tpl->assign('db_driver', $db_driver); $tpl->assign('db_server', $db_server); $tpl->assign('db_name', $db_name); $tpl->assign('db_user', $db_user); $tpl->assign('db_pass', $db_pass); // If passed, write config file and continue if (!is_null($db) && $db->IsConnected()) { $info = $db->GetRow("SHOW VARIABLES LIKE 'character_set_database'"); $encoding = 0 == strcasecmp($info[1], 'utf8') ? 'utf8' : 'latin1'; // Write database settings to framework.config.php $result = CerberusInstaller::saveFrameworkConfig($db_driver, $encoding, $db_server, $db_name, $db_user, $db_pass); // [JAS]: If we didn't save directly to the config file, user action required if (0 != strcasecmp($result, 'config')) { $tpl->assign('result', $result); $tpl->assign('config_path', APP_PATH . "/framework.config.php"); $tpl->assign('template', 'steps/step_config_file.tpl'); } else { // skip the config writing step $tpl->assign('step', STEP_INIT_DB); $tpl->display('steps/redirect.tpl'); exit; } } else { // If failed, re-enter $tpl->assign('failed', true); $tpl->assign('template', 'steps/step_database.tpl');