sb.setConfig("content.phpbb3.ppf", ppf);
sb.setConfig("content.phpbb3.dumpfile", dumpfile);
if (post.containsKey("check")) {
try {
Dao db = new PhpBB3Dao(
urlstub,
dbtype,
dbhost,
dbport,
dbname,
prefix,
dbuser,
dbpw
);
prop.put("check", 1);
prop.put("check_posts", db.size());
prop.putHTML("check_first", db.first().toString());
prop.putHTML("check_last", db.latest().toString());
db.close();
} catch (Exception e) {
Log.logException(e);
prop.put("check", 2);
prop.put("check_error", e.getMessage());
}
}
if (post.containsKey("export")) {
try {
Dao db = new PhpBB3Dao(
urlstub,
dbtype,
dbhost,
dbport,
dbname,
prefix,
dbuser,
dbpw
);
int files = db.writeSurrogates(db.query(0, -1, 100), sb.surrogatesInPath, "fullexport-" + GenericFormatter.SHORT_SECOND_FORMATTER.format(), ppf);
prop.put("export", 1);
prop.put("export_files", files);
db.close();
} catch (Exception e) {
Log.logException(e);
prop.put("export", 2);
prop.put("export_error", e.getMessage());
}