summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-03-21 14:48:47 +0400
committerAndrew Dolgov <[email protected]>2013-03-21 14:48:47 +0400
commit764555ff8af2ca8f7aad5e882bbf837c6e65cbc7 (patch)
tree162543f4fa766c4081b7a1ab59205f00536e2d12 /classes
parent84b48db4a7306ec1905cbfc044f89055aefdca0e (diff)
rework update.php to use getopt; allow --task parameter
Diffstat (limited to 'classes')
-rw-r--r--classes/pluginhost.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/classes/pluginhost.php b/classes/pluginhost.php
index 79544b01b..710435ae4 100644
--- a/classes/pluginhost.php
+++ b/classes/pluginhost.php
@@ -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);
}