From 5eb0f3d640374a82a026164942adc79bb1262576 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 4 Mar 2021 09:22:24 +0300 Subject: bring back web dbupdate using new migrations system --- classes/handler/public.php | 150 +++++++++++++++++++++++++-------------------- 1 file changed, 84 insertions(+), 66 deletions(-) (limited to 'classes/handler/public.php') diff --git a/classes/handler/public.php b/classes/handler/public.php index 08df7bbc1..0e82b6469 100755 --- a/classes/handler/public.php +++ b/classes/handler/public.php @@ -623,33 +623,57 @@ class Handler_Public extends Handler { - Database Updater + Tiny Tiny RSS: Database Updater - - + + + foreach (["lib/dojo/dojo.js", + "lib/dojo/tt-rss-layer.js", + "js/common.js", + "js/utility.js"] as $jsfile) { + + echo javascript_tag($jsfile); + + } ?> + + + + + - + @@ -660,72 +684,66 @@ class Handler_Public extends Handler { " . T_sprintf("Performing updates to version %d", Db_Updater::SCHEMA_VERSION) . ""; - for ($i = Config::get_schema_version(true) + 1; $i <= Db_Updater::SCHEMA_VERSION; $i++) { - print ""; +
migrate();
+							Debug::set_loglevel(Debug::LOG_NORMAL);
+							Debug::set_enabled(false);
+						?>
- print_error("One of the updates failed. Either retry the process or perform updates manually."); + + - print "
- - - ".__("Return to Tiny Tiny RSS")." -
"; +
+ + "return confirmDbUpdate()"]) ?> +
+ + - return; - } else { - print "
  • " . __("Completed.") . "
  • "; - print ""; - } - } + + - print "".__("Return to Tiny Tiny RSS").""; + - } else { - print_notice("Tiny Tiny RSS database is up to date."); + - print "".__("Return to Tiny Tiny RSS").""; + is_migration_needed()) { - print "

    ".T_sprintf("Tiny Tiny RSS database needs update to the latest version (%d to %d).", - Config::get_schema_version(true), Db_Updater::SCHEMA_VERSION)."

    "; + ?> +

    - if (Config::get(Config::DB_TYPE) == "mysql") { - print_error("READ THIS: Due to MySQL limitations, your database is not completely protected while updating. ". - "Errors may put it in an inconsistent state requiring manual rollback. BACKUP YOUR DATABASE BEFORE CONTINUING."); - } else { - print_warning("Please backup your database before proceeding."); - } + - print "
    - - -
    "; +
    + + "return confirmDbUpdate()"]) ?> +
    - } else { + + + - print_notice("Tiny Tiny RSS database is up to date."); + - print "".__("Return to Tiny Tiny RSS").""; + -- cgit v1.2.3