X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=update.php;h=d039d062e19ccb08979568ab72ccb57505a54cf8;hb=73f28fe979c48a88eb7b4037d7f0f708f8177f4c;hp=8a5512efbbf3840e476b00e85ea4860aeb0761d5;hpb=6cbe53c9f5e9c369977b737f897a621f00fba90b;p=tt-rss.git diff --git a/update.php b/update.php index 8a5512ef..d039d062 100755 --- a/update.php +++ b/update.php @@ -13,11 +13,16 @@ require_once "config.php"; require_once "db.php"; require_once "db-prefs.php"; - require_once "update_self.php"; if (!defined('PHP_EXECUTABLE')) define('PHP_EXECUTABLE', '/usr/bin/php'); + // Create a database connection. + $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); + + init_connection($link); + + $op = $argv; if (count($argv) == 0 && !defined('STDIN')) { @@ -48,12 +53,17 @@ print " -cleanup-tags - perform tags table maintenance\n"; print " -get-feeds - receive popular feeds from linked instances\n"; print " -import USER FILE - import articles from XML\n"; - print " -update-self - update tt-rss installation to latest version\n"; print " -quiet - don't show messages\n"; print " -indexes - recreate missing schema indexes\n"; print " -convert-filters - convert type1 filters to type2\n"; print " -force-update - force update of all feeds\n"; print " -help - show this help\n"; + print "Plugin options:\n"; + + foreach ($pluginhost->get_commands() as $command => $data) { + printf(" %-19s - %s\n", "$command", $data["description"]); + } + return; } @@ -74,11 +84,6 @@ "Maybe another update process is already running.\n"); } - // Create a database connection. - $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); - - init_connection($link); - if (in_array("-feeds", $op)) { // Update all feeds needing a update. update_daemon_common($link); @@ -228,17 +233,6 @@ _debug("all done."); } - if (in_array("-update-self", $op)) { - _debug("Warning: self-updating is experimental. Use at your own risk."); - _debug("Please backup your tt-rss directory before continuing. Your database will not be modified."); - _debug("Type 'yes' to continue."); - - if (read_stdin() != 'yes') - exit; - - update_self($link, in_array("-force", $op)); - } - if (in_array("-convert-filters", $op)) { _debug("WARNING: this will remove all existing type2 filters."); _debug("Type 'yes' to continue."); @@ -297,6 +291,8 @@ last_updated = '1970-01-01'"); } + $pluginhost->run_commands($op); + db_close($link); if ($lock_handle != false) {