Server Interface.
More...
|
| addFunction ($function, $namespace= '') |
| Attach a function as a server method.
|
|
| setClass ($class, $namespace= '', $argv=null) |
| Attach a class to a server.
|
|
| fault ($fault=null, $code=404) |
| Generate a server fault.
|
|
| handle ($request=false) |
| Handle a request.
|
|
| getFunctions () |
| Return a server definition array.
|
|
| loadFunctions ($definition) |
| Load server definition.
|
|
| setPersistence ($mode) |
| Set server persistence.
|
|
| setReturnResponse ($flag=true) |
| Sets auto-response flag for the server.
|
|
| getReturnResponse () |
| Returns auto-response flag of the server.
|
|
| getResponse () |
| Returns last produced response.
|
|
addFunction |
( |
|
$function, |
|
|
|
$namespace = '' |
|
) |
| |
Attach a function as a server method.
Namespacing is primarily for xmlrpc, but may be used with other implementations to prevent naming collisions.
- Parameters
-
string | $function | |
string | $namespace | |
| null|array | Optional array of arguments to pass to callback at dispatch. |
- Returns
- void
Implemented in Server, Server, and Server.
fault |
( |
|
$fault = null , |
|
|
|
$code = 404 |
|
) |
| |
Generate a server fault.
- Parameters
-
- Returns
- mixed
Implemented in Server, and Server.
Return a server definition array.
Returns a server definition array as created using Reflection. Can be used for server introspection, documentation, or persistence.
- Returns
- array
Implemented in Server, Server, and AbstractServer.
Returns last produced response.
- Returns
- string|object Content of last response, or response object that implements __toString() methods.
Implemented in Server, Server, and Server.
Returns auto-response flag of the server.
- Returns
- bool $flag Current status.
Implemented in Server, Server, and Server.
handle |
( |
|
$request = false | ) |
|
Handle a request.
Requests may be passed in, or the server may automatically determine the request based on defaults. Dispatches server request to appropriate method and returns a response
- Parameters
-
- Returns
- mixed
Implemented in Server, Server, and Server.
loadFunctions |
( |
|
$definition | ) |
|
Load server definition.
Used for persistence; loads a construct as returned by getFunctions().
- Parameters
-
- Returns
- void
Implemented in Server, Server, and Server.
setClass |
( |
|
$class, |
|
|
|
$namespace = '' , |
|
|
|
$argv = null |
|
) |
| |
Attach a class to a server.
The individual implementations should probably allow passing a variable number of arguments in, so that developers may define custom runtime arguments to pass to server methods.
Namespacing is primarily for xmlrpc, but could be used for other implementations as well.
- Parameters
-
mixed | $class | Class name or object instance to examine and attach to the server. |
string | $namespace | Optional namespace with which to prepend method names in the dispatch table. methods in the class will be valid callbacks. |
| null|array | Optional array of arguments to pass to callbacks at dispatch. |
- Returns
- void
Implemented in Server, Server, and Server.
Set server persistence.
- Todo:
- Determine how to implement this
- Parameters
-
- Returns
- void
Implemented in Server, Server, and Server.
setReturnResponse |
( |
|
$flag = true | ) |
|
Sets auto-response flag for the server.
To unify all servers, default behavior should be to auto-emit response.
- Parameters
-
- Returns
- Server Self instance.
Implemented in Server, Server, and Server.