Properties

$_methods

$_methods : array

Array of dispatchables

Type

array

$_classAllowed

$_classAllowed : array

Array of classes that can be called without being explicitly loaded

Keys are class names.

Type

array

$_production

$_production : boolean

Type

boolean — Production flag; whether or not to return exception messages

$_request

$_request : null|\Zend_Amf_Request

Request processed

Type

null|\Zend_Amf_Request

$_response

$_response : null|\Zend_Amf_Response

Class to use for responses

Type

null|\Zend_Amf_Response

$_table

$_table : array

Dispatch table of name => method pairs

Type

array

$_session

$_session : boolean

Type

boolean — session flag; whether or not to add a session to each response.

$_sesionNamespace

$_sesionNamespace : \Zend_Session_NameSpace

Namespace allows all AMF calls to not clobber other php session variables

Type

\Zend_Session_NameSpace — default session namespace zend_amf

$_sessionName

$_sessionName : string

Set the default session.name if php_

Type

string

$_acl

$_acl : \Zend_Acl

ACL handler object

Type

\Zend_Acl

Methods

__construct()

__construct() 

The server constructor

setAcl()

setAcl(\Zend_Acl  $acl) : \Zend_Amf_Server

Set ACL adapter

Parameters

\Zend_Acl $acl

Returns

\Zend_Amf_Server

getAcl()

getAcl() : \Zend_Acl

Get ACL adapter

Returns

\Zend_Acl

setProduction()

setProduction(boolean  $flag) : \Zend_Amf_Server

Set production flag

Parameters

boolean $flag

Returns

\Zend_Amf_Server

isProduction()

isProduction() : boolean

Whether or not the server is in production

Returns

boolean

setSession()

setSession(  $namespace = 'Zend_Amf') : \Zend_Amf_Server

Parameters

$namespace

Returns

\Zend_Amf_Server

isSession()

isSession() : boolean

Whether of not the server is using sessions

Returns

boolean

handle()

handle(null|\Zend_Amf_Request  $request = null) : \Zend_Amf_Response

Handle an AMF call from the gateway.

Requests may be passed in, or the server may automagically determine the request based on defaults. Dispatches server request to appropriate method and returns a response

Parameters

null|\Zend_Amf_Request $request

Optional

Returns

\Zend_Amf_Response

setRequest()

setRequest(string|\Zend_Amf_Request  $request) : \Zend_Amf_Server

Set request object

Parameters

string|\Zend_Amf_Request $request

Returns

\Zend_Amf_Server

getRequest()

getRequest() : null|\Zend_Amf_Request

Return currently registered request object

Returns

null|\Zend_Amf_Request

setResponse()

setResponse(string|\Zend_Amf_Server_Response  $response) : \Zend_Amf_Server

Public access method to private Zend_Amf_Server_Response refrence

Parameters

string|\Zend_Amf_Server_Response $response

Returns

\Zend_Amf_Server

getResponse()

getResponse() : \Zend_Amf_Server_Response

get a refrence to the Zend_Amf_response instance

Returns

\Zend_Amf_Server_Response

setClass()

setClass(string|object  $class, string  $namespace = '',   $argv = null) : \Zend_Amf_Server

Attach a class or object to the server

Class may be either a class name or an instantiated object. Reflection is done on the class or object to determine the available public methods, and each is attached to the server as and available method. If a $namespace has been provided, that namespace is used to prefix AMF service call.

Parameters

string|object $class

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

string $namespace

Optional

$argv

Throws

\Zend_Amf_Server_Exception

on invalid input

Returns

\Zend_Amf_Server

addFunction()

addFunction(string|array  $function, string  $namespace = '') : \Zend_Amf_Server

Attach a function to the server

Additional arguments to pass to the function at dispatch may be passed; any arguments following the namespace will be aggregated and passed at dispatch time.

Parameters

string|array $function

Valid callback

string $namespace

Optional namespace prefix

Throws

\Zend_Amf_Server_Exception

Returns

\Zend_Amf_Server

addDirectory()

addDirectory(string  $dir) 

Creates an array of directories in which services can reside.

TODO: add support for prefixes?

Parameters

string $dir

getDirectory()

getDirectory() : array

Returns an array of directories that can hold services.

Returns

array

fault()

fault(string|\Exception  $fault = null, integer  $code = 404) : void

Raise a server fault

Unimplemented

Parameters

string|\Exception $fault
integer $code

getFunctions()

getFunctions() : array

Returns a list of registered methods

Returns an array of dispatchables (Zend_Server_Reflection_Function, _Method, and _Class items).

Returns

array

setPersistence()

setPersistence(mixed  $mode) : void

Set server persistence

Unimplemented

Parameters

mixed $mode

loadFunctions()

loadFunctions(array  $definition) : void

Load server definition

Unimplemented

Parameters

array $definition

setClassMap()

setClassMap(string  $asClass, string  $phpClass) : \Zend_Amf_Server

Map ActionScript classes to PHP classes

Parameters

string $asClass
string $phpClass

Returns

\Zend_Amf_Server

listMethods()

listMethods() : array

List all available methods

Returns an array of method names.

Returns

array

_checkAcl()

_checkAcl(string|object  $object, string  $function) : \unknown_type

Check if the ACL allows accessing the function or method

Parameters

string|object $object

Object or class being accessed

string $function

Function or method being acessed

Returns

\unknown_type

_dispatch()

_dispatch(string  $method,   $params = null,   $source = null) : mixed

Loads a remote class or method and executes the function and returns the result

Parameters

string $method

Is the method to execute

$params
$source

Throws

\Zend_Amf_Server_Exception

Returns

mixed —

$response the result of executing the method

_errorMessage()

_errorMessage(integer  $objectEncoding, string  $message, string  $description, mixed  $detail, integer  $code, integer  $line) : \Zend_Amf_Value_Messaging_ErrorMessage|array

Create appropriate error message

Parameters

integer $objectEncoding

Current AMF encoding

string $message

Message that was being processed when error happened

string $description

Error description

mixed $detail

Detailed data about the error

integer $code

Error code

integer $line

Error line

Returns

\Zend_Amf_Value_Messaging_ErrorMessage|array

_handleAuth()

_handleAuth(string  $userid, string  $password) : boolean

Handle AMF authenticaton

Parameters

string $userid
string $password

Returns

boolean

_handle()

_handle(\Zend_Amf_Request  $request) : \Zend_Amf_Response

Takes the deserialized AMF request and performs any operations.

Parameters

\Zend_Amf_Request $request

Throws

\Zend_Amf_server_Exception|\Exception

Returns

\Zend_Amf_Response

_buildDispatchTable()

_buildDispatchTable() : void

(Re)Build the dispatch table

The dispatch table consists of a an array of method name => Zend_Server_Reflection_Function_Abstract pairs