Lines Matching defs:method

19  *     'method.remoteName' => array(
23 * 'name' => 'method name in class',
25 * 'public' => 1/0 - method bypass default group check (used by login)
26 * ['doc' = 'method documentation'],
31 * core methods begin by a 'dokuwiki' or 'wiki' followed by a . and the method name itself.
34 * plugin methods are formed like 'plugin.<plugin name>.<method name>'.
53 * The data inside is 'custom.call.something' => array('plugin name', 'remote method name')
55 * The remote method name is the same as in the remote name returned by _getMethods().
83 * Call a method via remote api.
85 * @param string $method name of the method to call.
86 * @param array $args arguments to pass to the given method
87 * @return mixed result of method call, must be a primitive type.
90 public function call($method, $args = array())
95 // Ensure we have at least one '.' in $method
96 list($type, $pluginName, /* $call */) = explode('.', $method . '.', 3);
98 return $this->callPlugin($pluginName, $method, $args);
100 if ($this->coreMethodExist($method)) {
101 return $this->callCoreMethod($method, $args);
103 return $this->callCustomCallPlugin($method, $args);
109 * @param string $name name of the method
110 * @return bool if method exists
121 * @param string $method name of method
124 * @throws RemoteException if method not exists
126 private function callCustomCallPlugin($method, $args)
129 if (!array_key_exists($method, $customCalls)) {
132 list($plugin, $method) = $customCalls[$method];
133 $fullMethod = "plugin.$plugin.$method";
154 * Call a plugin method
157 * @param string $method method name
159 * @return mixed return of custom method
162 private function callPlugin($pluginName, $method, $args)
169 $this->checkAccess($methods[$method]);
170 $name = $this->getMethodName($methods, $method);
182 * Call a core method
184 * @param string $method name of method
187 * @throws RemoteException if method not exist
189 private function callCoreMethod($method, $args)
192 $this->checkAccess($coreMethods[$method]);
193 if (!isset($coreMethods[$method])) {
196 $this->checkArgumentLength($coreMethods[$method], $args);
199 return call_user_func_array(array($this->coreMethods, $this->getMethodName($coreMethods, $method)), $args);
210 * @param array $methodMeta data about the method
227 * @param array $methodMeta data about the method
239 * Determine the name of the real method
242 * @param string $method name of method
245 private function getMethodName($methodMeta, $method)
247 if (isset($methodMeta[$method]['name'])) {
248 return $methodMeta[$method]['name'];
250 $method = explode('.', $method);
251 return $method[count($method) - 1];
292 throw new AccessDeniedException('server error. not authorized to call method', -32604);
323 foreach ($methods as $method => $meta) {
324 $this->pluginMethods["plugin.$pluginName.$method"] = $meta;