[ Index ]

PHP Cross Reference of DokuWiki




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

(no description)

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

Defines 1 class

Api:: (21 methods):

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:
'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

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

return: array with information to all available methods

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

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

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

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

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

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

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

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

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

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

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

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

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

return: array all core methods.
param: ApiCore|\RemoteAPICoreTest $apiCore this parameter is used for testing.

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

return: mixed
param: mixed $data

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

return: mixed
param: mixed $data

dummyTransformation($data)   X-Ref
A simple transformation

return: mixed
param: mixed $data

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

param: callback $dateTransformation

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

param: callback $fileTransformation

argumentWarningHandler($errno, $errstr)   X-Ref
The error handler that catches argument-related warnings