Abstract Server implementation

 Methods

Constructor

__construct() 

Setup server description

Attach a function as a server method

addFunction(string $function, string $namespace) : void
Inherited

Namespacing is primarily for xmlrpc, but may be used with other implementations to prevent naming collisions.

inherited_from \Zend\Server\Server::addFunction()

Parameters

$function

string

$namespace

string

Generate a server fault

fault(mixed $fault, int $code) : mixed
Inherited

inherited_from \Zend\Server\Server::fault()

Parameters

$fault

mixed

$code

int

Returns

mixed

Returns a list of registered methods

getFunctions() : \Zend\Server\Definition

Returns an array of method definitions.

Returns

Returns last produced response.

getResponse() : string | object
Inherited

inherited_from \Zend\Server\Server::getResponse()

Returns

stringobjectContent of last response, or response object that implements __toString() methods.

Returns auto-response flag of the server.

getReturnResponse() : bool
Inherited

inherited_from \Zend\Server\Server::getReturnResponse()

Returns

bool$flag Current status.

Handle a request

handle(mixed $request) : mixed
Inherited

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

inherited_from \Zend\Server\Server::handle()

Parameters

$request

mixed

Returns

mixed

Load server definition

loadFunctions(array $definition) : void
Inherited

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

inherited_from \Zend\Server\Server::loadFunctions()

Parameters

$definition

array

Attach a class to a server

setClass(mixed $class, string $namespace, null | array $argv) : void
Inherited

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.

inherited_from \Zend\Server\Server::setClass()

Parameters

$class

mixed

Class name or object instance to examine and attach to the server.

$namespace

string

Optional namespace with which to prepend method names in the dispatch table. methods in the class will be valid callbacks.

$argv

nullarray

Optional array of arguments to pass to callbacks at dispatch.

Set server persistence

setPersistence(int $mode) : void
Inherited

inherited_from \Zend\Server\Server::setPersistence()

Parameters

$mode

int

Sets auto-response flag for the server.

setReturnResponse(bool $flag) : \Zend\Server\Server
Inherited

To unify all servers, default behavior should be to auto-emit response.

inherited_from \Zend\Server\Server::setReturnResponse()

Parameters

$flag

bool

Returns

\Zend\Server\ServerSelf instance.

Build callback for method signature

_buildCallback(\Zend\Server\Reflection\AbstractFunction $reflection) : \Zend\Server\Method\Callback

Build a method signature

_buildSignature(\Zend\Server\Reflection\AbstractFunction $reflection, null | string | object $class) : \Zend\Server\Method\Definition

Parameters

$class

nullstringobject

Exceptions

\Zend\Server\Exception\RuntimeException on duplicate entry

Returns

Dispatch method

_dispatch(\Zend\Server\Method\Definition $invokable, array $params) : mixed

Parameters

$params

array

Returns

mixed

Map PHP type to protocol type

_fixType(string $type) : string

Parameters

$type

string

Returns

string

 Properties

 

<p>Flag; whether or not overwriting existing methods is allowed</p>

$overwriteExistingMethods : bool

 

$table

$table : \Zend\Server\Definition