diff options
author | Dominik Eckelmann <deckelmann@gmail.com> | 2011-11-23 20:25:58 +0100 |
---|---|---|
committer | Dominik Eckelmann <deckelmann@gmail.com> | 2011-11-23 20:25:58 +0100 |
commit | 457ad80ad7c53870fc033997bfbf36e3904f9c4e (patch) | |
tree | e4cfc5271b9451ad086d9bd531c94d27384a0518 /inc/remote.php | |
parent | 402e0951b7e3ccf567702515bfe0b09cca8a5a93 (diff) | |
download | rpg-457ad80ad7c53870fc033997bfbf36e3904f9c4e.tar.gz rpg-457ad80ad7c53870fc033997bfbf36e3904f9c4e.tar.bz2 |
introduced remote api class
Diffstat (limited to 'inc/remote.php')
-rw-r--r-- | inc/remote.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/inc/remote.php b/inc/remote.php index ea5e23af3..13a38aa17 100644 --- a/inc/remote.php +++ b/inc/remote.php @@ -17,6 +17,7 @@ if (!defined('DOKU_INC')) die(); * 'args' => array( * 'type' => 'string|int|...', * ) + * 'return' => 'type' * ) * ) * @@ -102,8 +103,20 @@ class RemoteAPI { */ public function getPluginMethods() { if ($this->pluginMethods === null) { - // TODO: find plugin methods $this->pluginMethods = array(); + $plugins = plugin_list('remote'); + + foreach ($plugins as $pluginName) { + $plugin = plugin_load('remote', $pluginName); + if (!is_subclass_of($plugin, 'DokuWiki_Remote_Plugin')) { + throw new RemoteException("Plugin $pluginName dose not implement DokuWiki_Remote_Plugin"); + } + + $methods = $plugin->_getMethods(); + foreach ($methods as $method => $meta) { + $this->pluginMethods["plugin.$pluginName.$method"] = $meta; + } + } } return $this->pluginMethods; } |