|
|
|
@ -85,6 +85,7 @@
|
|
|
|
|
"debug-feed:",
|
|
|
|
|
"force-refetch",
|
|
|
|
|
"force-rehash",
|
|
|
|
|
"opml-export:",
|
|
|
|
|
"help");
|
|
|
|
|
|
|
|
|
|
foreach (PluginHost::getInstance()->get_commands() as $command => $data) {
|
|
|
|
@ -139,12 +140,13 @@
|
|
|
|
|
print " --debug-feed N - perform debug update of feed N\n";
|
|
|
|
|
print " --force-refetch - debug update: force refetch feed data\n";
|
|
|
|
|
print " --force-rehash - debug update: force rehash articles\n";
|
|
|
|
|
print " --opml-export \"USER FILE\" - export feeds of selected user to OPML\n";
|
|
|
|
|
print " --help - show this help\n";
|
|
|
|
|
print "Plugin options:\n";
|
|
|
|
|
|
|
|
|
|
foreach (PluginHost::getInstance()->get_commands() as $command => $data) {
|
|
|
|
|
$args = $data['arghelp'];
|
|
|
|
|
printf(" --%-19s - %s\n", "$command $args", $data["description"]);
|
|
|
|
|
printf(" --%-26s - %s\n", "$command $args", $data["description"]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
@ -483,6 +485,26 @@
|
|
|
|
|
Digest::send_headlines_digests();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (isset($options["opml-export"])) {
|
|
|
|
|
list ($user, $filename) = explode(" ", $options["opml-export"], 2);
|
|
|
|
|
|
|
|
|
|
Debug::log("Exporting feeds of user $user to $filename as OPML...");
|
|
|
|
|
|
|
|
|
|
$sth = $pdo->prepare("SELECT id FROM ttrss_users WHERE login = ?");
|
|
|
|
|
$sth->execute([$user]);
|
|
|
|
|
|
|
|
|
|
if ($res = $sth->fetch()) {
|
|
|
|
|
$opml = new OPML("");
|
|
|
|
|
|
|
|
|
|
$rc = $opml->opml_export($filename, $res["id"], false, true, true);
|
|
|
|
|
|
|
|
|
|
Debug::log($rc ? "Success." : "Failed.");
|
|
|
|
|
} else {
|
|
|
|
|
Debug::log("User not found: $user");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PluginHost::getInstance()->run_commands($options);
|
|
|
|
|
|
|
|
|
|
if (file_exists(LOCK_DIRECTORY . "/$lock_filename"))
|
|
|
|
|