// generate key to uniquely identify this installation $key = PommoHelper::makeCode(6); PommoAPI::configUpdate(array('key' => $key), TRUE); $pommo->reloadConfig(); // load configuration [depricated?], set message defaults, load templates Pommo::requireOnce($pommo->_baseDir . 'inc/helpers/messages.php'); PommoHelperMessages::resetDefault('all'); // install templates $file = $pommo->_baseDir . "install/sql.templates.php"; if (!PommoInstall::parseSQL(false, $file)) { $logger->addErr('Error Loading Default Mailing Templates.'); } // serialize the latest updates $GLOBALS['pommoFakeUpgrade'] = true; Pommo::requireOnce($pommo->_baseDir . 'install/helper.upgrade.php'); PommoUpgrade(); $logger->addMsg(Pommo::_T('Installation Complete! You may now login and setup poMMo.')); $logger->addMsg(Pommo::_T('Login Username: '******'admin'); $logger->addMsg(Pommo::_T('Login Password: '******'installed', TRUE); } else { // INSTALL FAILED $dbo->debug(FALSE); // drop existing poMMo tables foreach (array_keys($dbo->table) as $key) { $table = $dbo->table[$key]; $sql = 'DROP TABLE IF EXISTS ' . $table; $dbo->query($sql); } $logger->addErr('Installation failed! Enable debbuging to expose the problem.'); }
if (isset($_REQUEST['disableDebug'])) { unset($_REQUEST['debugInstall']); } elseif (isset($_REQUEST['debugInstall'])) { $smarty->assign('debug', TRUE); } if (empty($_REQUEST['continue'])) { $logger->addErr(sprintf(Pommo::_T('To upgrade poMMo, %s click here %s'), '<a href="' . Pommo::$_baseUrl . 'upgrade.php?continue=TRUE">', '</a>')); } else { $smarty->assign('attempt', TRUE); if (isset($_REQUEST['debugInstall'])) { $dbo->debug(TRUE); } if (isset($_REQUEST['forceUpgrade'])) { $GLOBALS['pommoFakeUpgrade'] = true; } if (PommoUpgrade()) { $logger->addErr(Pommo::_T('Upgrade Complete!')); // Read in RELEASE Notes -- TODO -> use file_get_contents() one day when everyone has PHP 4.3 $filename = Pommo::$_baseDir . 'docs/RELEASE'; $handle = fopen($filename, "r"); $x = fread($handle, filesize($filename)); fclose($handle); $smarty->assign('notes', $x); $smarty->assign('upgraded', TRUE); } else { $logger->addErr(Pommo::_T('Upgrade Failed!')); } // clear the working directory template files $smarty->display('upgrade.tpl'); require_once Pommo::$_baseDir . 'classes/Pommo_Helper_Maintenance.php'; if (!Pommo_Helper_Maintenance::delDir(Pommo::$_workDir . '/pommo/smarty')) {