[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/inc/Remote/ -> Api.php (summary)

(no description)

File Size: 180 lines (6 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Api:: (6 methods):
  getMethods()
  getCoreMethods()
  getPluginMethods()
  call()
  ensureApiIsEnabled()
  ensureAccessIsAllowed()


Class: Api  - X-Ref

This class provides information about remote access to the wiki.

== Types of methods ==
There are two types of remote methods. The first is the core methods.
These are always available and provided by dokuwiki.
The other is plugin methods. These are provided by remote plugins.

== Information structure ==
The information about methods will be given in an array with the following structure:
array(
'method.remoteName' => array(
'args' => array(
'type eg. string|int|...|date|file',
)
'name' => 'method name in class',
'return' => 'type',
'public' => 1/0 - method bypass default group check (used by login)
['doc' = 'method documentation'],
)
)

plugin names are formed the following:
core methods begin by a 'dokuwiki' or 'wiki' followed by a . and the method name itself.
i.e.: dokuwiki.version or wiki.getPage

plugin methods are formed like 'plugin.<plugin name>.<method name>'.
i.e.: plugin.clock.getTime or plugin.clock_gmt.getTime
getMethods()   X-Ref
Get all available methods with remote access.

return: ApiCall[] with information to all available methods

getCoreMethods($apiCore = null)   X-Ref
Collects all the core methods

param: ApiCore|MockApiCore $apiCore this parameter is used for testing.
return: ApiCall[] all core methods.

getPluginMethods()   X-Ref
Collects all the methods of the enabled Remote Plugins

return: ApiCall[] all plugin methods.

call($method, $args = [])   X-Ref
Call a method via remote api.

param: string $method name of the method to call.
param: array $args arguments to pass to the given method
return: mixed result of method call, must be a primitive type.

ensureApiIsEnabled()   X-Ref
Check that the API is generally enabled

return: void

ensureAccessIsAllowed(ApiCall $method)   X-Ref
Check if the current user is allowed to call the given method

param: ApiCall $method
return: void