Dotclear 2.24
|
REST Server. More...
Public Member Functions | |
__construct () | |
addFunction (string $name, $callback) | |
serve (string $encoding='UTF-8') | |
Data Fields | |
$rsp | |
$functions = [] | |
Protected Member Functions | |
callFunction (string $name, array $get, array $post) | |
REST Server.
A very simple REST server implementation
__construct | ( | ) |
Constructor
Reimplemented in dcRestServer.
addFunction | ( | string | $name, |
$callback | |||
) |
Add Function
This adds a new function to the server. $callback should be a valid PHP callback. Callback function takes two arguments: GET and POST values.
string | $name | Function name |
callable | array | $callback | Callback function |
|
protected |
Call Function
This method calls callback named $name.
string | $name | Function name |
array | $get | GET values |
array | $post | POST values |
Reimplemented in dcRestServer.
Referenced by serve().
serve | ( | string | $encoding = 'UTF-8' | ) |
Main server
This method creates the main server.
string | $encoding | Server charset |
Reimplemented in dcRestServer.
References callFunction().
$rsp |
$functions = [] |