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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user