1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 13:35:56 +00:00

rework update.php to use getopt; allow --task parameter

This commit is contained in:
Andrew Dolgov
2013-03-21 14:48:47 +04:00
parent 84b48db4a7
commit 764555ff8a
2 changed files with 59 additions and 36 deletions

View File

@@ -171,7 +171,7 @@ class PluginHost {
}
function add_command($command, $description, $sender) {
$command = "-" . str_replace("-", "_", strtolower($command));
$command = str_replace("-", "_", strtolower($command));
$this->commands[$command] = array("description" => $description,
"class" => $sender);
@@ -201,7 +201,7 @@ class PluginHost {
function run_commands($args) {
foreach ($this->get_commands() as $command => $data) {
if (in_array($command, $args)) {
if (isset($args[$command])) {
$command = str_replace("-", "", $command);
$data["class"]->$command($args);
}