[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

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

(no description)

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

Defines 1 class

Api:: (20 methods):
  __construct()
  getMethods()
  call()
  coreMethodExist()
  callCustomCallPlugin()
  getCustomCallPlugins()
  callPlugin()
  callCoreMethod()
  checkAccess()
  checkArgumentLength()
  getMethodName()
  hasAccess()
  forceAccess()
  getPluginMethods()
  getCoreMethods()
  toFile()
  toDate()
  dummyTransformation()
  setDateTransformation()
  setFileTransformation()


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
__construct()   X-Ref
constructor


getMethods()   X-Ref
Get all available methods with remote access.

return: array with information to all available methods

call($method, $args = array()   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.

coreMethodExist($name)   X-Ref
Check existance of core methods

param: string $name name of the method
return: bool if method exists

callCustomCallPlugin($method, $args)   X-Ref
Try to call custom methods provided by plugins

param: string $method name of method
param: array $args
return: mixed

getCustomCallPlugins()   X-Ref
Returns plugin calls that are registered via RPC_CALL_ADD action

triggers: RPC_CALL_ADD
return: array with pairs of custom plugin calls

callPlugin($pluginName, $method, $args)   X-Ref
Call a plugin method

param: string $pluginName
param: string $method method name
param: array $args
return: mixed return of custom method

callCoreMethod($method, $args)   X-Ref
Call a core method

param: string $method name of method
param: array $args
return: mixed

checkAccess($methodMeta)   X-Ref
Check if access should be checked

param: array $methodMeta data about the method

checkArgumentLength($methodMeta, $args)   X-Ref
Check the number of parameters

param: array $methodMeta data about the method
param: array $args

getMethodName($methodMeta, $method)   X-Ref
Determine the name of the real method

param: array $methodMeta list of data of the methods
param: string $method name of method
return: string

hasAccess()   X-Ref
Perform access check for current user

return: bool true if the current user has access to remote api.

forceAccess()   X-Ref
Requests access

return: void

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

return: array all plugin methods.

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

param: ApiCore $apiCore this parameter is used for testing. Here you can pass a non-default RemoteAPICore
return: array all core methods.

toFile($data)   X-Ref
Transform file to xml

param: mixed $data
return: mixed

toDate($data)   X-Ref
Transform date to xml

param: mixed $data
return: mixed

dummyTransformation($data)   X-Ref
A simple transformation

param: mixed $data
return: mixed

setDateTransformation($dateTransformation)   X-Ref
Set the transformer function

param: callback $dateTransformation

setFileTransformation($fileTransformation)   X-Ref
Set the transformer function

param: callback $fileTransformation