summaryrefslogtreecommitdiff
path: root/update.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2012-12-24 09:52:15 +0400
committerAndrew Dolgov <[email protected]>2012-12-24 09:52:15 +0400
commit73f28fe979c48a88eb7b4037d7f0f708f8177f4c (patch)
treec531dbb1e141219b4943e3ee8991d764172cb140 /update.php
parent6cbe53c9f5e9c369977b737f897a621f00fba90b (diff)
add support for registering update.php commands; move rest of the self-updating stuff into updater plugin
Diffstat (limited to 'update.php')
-rwxr-xr-xupdate.php32
1 files changed, 14 insertions, 18 deletions
diff --git a/update.php b/update.php
index 8a5512efb..d039d062e 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) {