Zend Framework  3.0
Public Member Functions | List of all members
Server Interface Reference

Server Interface. More...

Public Member Functions

 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.
 

Detailed Description

Server Interface.

Member Function Documentation

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|arrayOptional 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
mixed$fault
int$code
Returns
mixed

Implemented in Server, and Server.

getFunctions ( )

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.

getResponse ( )

Returns last produced response.

Returns
string|object Content of last response, or response object that implements __toString() methods.

Implemented in Server, Server, and Server.

getReturnResponse ( )

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
mixed$request
Returns
mixed

Implemented in Server, Server, and Server.

loadFunctions (   $definition)

Load server definition.

Used for persistence; loads a construct as returned by getFunctions().

Parameters
array$definition
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$classClass name or object instance to examine and attach to the server.
string$namespaceOptional namespace with which to prepend method names in the dispatch table. methods in the class will be valid callbacks.
null|arrayOptional array of arguments to pass to callbacks at dispatch.
Returns
void

Implemented in Server, Server, and Server.

setPersistence (   $mode)

Set server persistence.

Todo:
Determine how to implement this
Parameters
int$mode
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
bool$flag
Returns
Server Self instance.

Implemented in Server, Server, and Server.