summaryrefslogtreecommitdiff
path: root/classes/pluginhost.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-04-12 08:18:43 +0400
committerAndrew Dolgov <[email protected]>2013-04-12 08:18:43 +0400
commit79f9bef767ba0e0a35c8bf8411bb90feac35a551 (patch)
treec2a0fc927f6738ff27e26d8b08ea612ae9aad117 /classes/pluginhost.php
parent5e725f9c8cde3d283ff15bc7e2d75d69b0cfb193 (diff)
add support for plugins adding API methods
Diffstat (limited to 'classes/pluginhost.php')
-rw-r--r--classes/pluginhost.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/classes/pluginhost.php b/classes/pluginhost.php
index 9ae7b809e..7c6fab9a0 100644
--- a/classes/pluginhost.php
+++ b/classes/pluginhost.php
@@ -7,6 +7,7 @@ class PluginHost {
private $commands = array();
private $storage = array();
private $feeds = array();
+ private $api_methods = array();
private $owner_uid;
private $debug;
@@ -347,5 +348,14 @@ class PluginHost {
return PLUGIN_FEED_BASE_INDEX - 1 + abs($feed);
}
+ function add_api_method($name, $sender) {
+ if ($this->is_system($sender)) {
+ $this->api_methods[strtolower($name)] = $sender;
+ }
+ }
+
+ function get_api_method($name) {
+ return $this->api_methods[$name];
+ }
}
?>