mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2026-01-06 23:29:15 +00:00
add support for plugins adding API methods
This commit is contained in:
@@ -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];
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user