]> git.wh0rd.org - tt-rss.git/blobdiff - classes/pluginhost.php
add support for plugins adding API methods
[tt-rss.git] / classes / pluginhost.php
index 9ae7b809e948935cfc98393c1bd76cd27b1a1937..7c6fab9a0ebcf8740d5a2380ecfa2a8cc4a8b292 100644 (file)
@@ -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];
+       }
 }
 ?>