Moodle  2.2.1
http://www.collinsharper.com
Zend_Amf_Server Class Reference
Inheritance diagram for Zend_Amf_Server:
Collaboration diagram for Zend_Amf_Server:

Public Member Functions

 __construct ()
 setAuth (Zend_Amf_Auth_Abstract $auth)
 getAuth ()
 setAcl (Zend_Acl $acl)
 getAcl ()
 setProduction ($flag)
 isProduction ()
 setSession ($namespace= 'Zend_Amf')
 isSession ()
 handle ($request=null)
 setRequest ($request)
 getRequest ()
 setResponse ($response)
 getResponse ()
 setClass ($class, $namespace= '', $argv=null)
 addFunction ($function, $namespace= '')
 addDirectory ($dir)
 getDirectory ()
 fault ($fault=null, $code=404)
 getFunctions ()
 setPersistence ($mode)
 loadFunctions ($definition)
 setClassMap ($asClass, $phpClass)
 listMethods ()

Protected Member Functions

 _checkAcl ($object, $function)
 getLoader ()
 _dispatch ($method, $params=null, $source=null)
 _loadCommandMessage (Zend_Amf_Value_Messaging_CommandMessage $message)
 _errorMessage ($objectEncoding, $message, $description, $detail, $code, $line)
 _handleAuth ($userid, $password)
 _handle (Zend_Amf_Request $request)
 _buildDispatchTable ()

Protected Attributes

 $_methods = array()
 $_classAllowed = array()
 $_loader
 $_production = true
 $_request = null
 $_response
 $_table = array()
 $_session = false
 $_sesionNamespace = 'zend_amf'
 $_sessionName = 'PHPSESSID'
 $_auth
 $_acl

Detailed Description

Definition at line 58 of file Server.php.


Constructor & Destructor Documentation

The server constructor

Definition at line 137 of file Server.php.

Here is the call graph for this function:


Member Function Documentation

_buildDispatchTable ( ) [protected]

(Re)Build the dispatch table

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

Returns:
void

Definition at line 822 of file Server.php.

Here is the caller graph for this function:

_checkAcl ( object,
function 
) [protected]

Check if the ACL allows accessing the function or method

Parameters:
string | object$objectObject or class being accessed
string$functionFunction or method being accessed
Returns:
unknown_type

Definition at line 234 of file Server.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_dispatch ( method,
params = null,
source = null 
) [protected]

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

Parameters:
string$methodIs the method to execute
mixed$paramvalues for the method
Returns:
mixed $response the result of executing the method
Exceptions:
Zend_Amf_Server_Exception

Definition at line 296 of file Server.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_errorMessage ( objectEncoding,
message,
description,
detail,
code,
line 
) [protected]

Create appropriate error message

Parameters:
int$objectEncodingCurrent AMF encoding
string$messageMessage that was being processed when error happened
string$descriptionError description
mixed$detailDetailed data about the error
int$codeError code
int$lineError line
Returns:
Zend_Amf_Value_Messaging_ErrorMessage|array

Definition at line 422 of file Server.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_handle ( Zend_Amf_Request request) [protected]

Takes the deserialized AMF request and performs any operations.

Todo:

should implement and SPL observer pattern for custom AMF headers

DescribeService support

Parameters:
Zend_Amf_Request$request
Returns:
Zend_Amf_Response
Exceptions:
Zend_Amf_server_Exception|Exception

Definition at line 483 of file Server.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_handleAuth ( userid,
password 
) [protected]

Handle AMF authentication

Parameters:
string$userid
string$password
Returns:
boolean

Definition at line 451 of file Server.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Handles each of the 11 different command message types.

A command message is a flex.messaging.messages.CommandMessage

See also:
Zend_Amf_Value_Messaging_CommandMessage
Parameters:
Zend_Amf_Value_Messaging_CommandMessage$message
Returns:
Zend_Amf_Value_Messaging_AcknowledgeMessage

Definition at line 375 of file Server.php.

Here is the call graph for this function:

Here is the caller graph for this function:

addDirectory ( dir)

Creates an array of directories in which services can reside. TODO: add support for prefixes?

Parameters:
string$dir

Definition at line 799 of file Server.php.

Here is the call graph for this function:

addFunction ( function,
namespace = '' 
)

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$functionValid callback
string$namespaceOptional namespace prefix
Returns:
Zend_Amf_Server
Exceptions:
Zend_Amf_Server_Exception

Implements Zend_Server_Interface.

Definition at line 767 of file Server.php.

Here is the call graph for this function:

fault ( fault = null,
code = 404 
)

Raise a server fault

Unimplemented

Parameters:
string | Exception$fault
Returns:
void

Implements Zend_Server_Interface.

Reimplemented in Moodle_Amf_Server.

Definition at line 867 of file Server.php.

getAcl ( )

Get ACL adapter

Returns:
Zend_Acl

Definition at line 179 of file Server.php.

getAuth ( )

Get authentication adapter

Returns:
Zend_Amf_Auth_Abstract

Definition at line 158 of file Server.php.

Returns an array of directories that can hold services.

Returns:
array

Definition at line 809 of file Server.php.

Here is the call graph for this function:

Returns a list of registered methods

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

Returns:
array

Implements Zend_Server_Interface.

Definition at line 879 of file Server.php.

getLoader ( ) [protected]

Get PluginLoader for the Server

Returns:
Zend_Loader_PluginLoader

Definition at line 278 of file Server.php.

Here is the caller graph for this function:

Return currently registered request object

Returns:
null|Zend_Amf_Request

Definition at line 665 of file Server.php.

Here is the call graph for this function:

Here is the caller graph for this function:

get a reference to the Zend_Amf_response instance

Returns:
Zend_Amf_Server_Response

Definition at line 702 of file Server.php.

Here is the call graph for this function:

Here is the caller graph for this function:

handle ( request = null)

Handle an AMF call from the gateway.

Parameters:
null | Zend_Amf_Request$requestOptional
Returns:
Zend_Amf_Response

Implements Zend_Server_Interface.

Definition at line 607 of file Server.php.

Here is the call graph for this function:

Whether or not the server is in production

Returns:
bool

Definition at line 201 of file Server.php.

Here is the caller graph for this function:

isSession ( )

Whether of not the server is using sessions

Returns:
bool

Definition at line 222 of file Server.php.

Here is the caller graph for this function:

List all available methods

Returns an array of method names.

Returns:
array

Definition at line 929 of file Server.php.

loadFunctions ( definition)

Load server definition

Unimplemented

Parameters:
array$definition
Returns:
void

Implements Zend_Server_Interface.

Definition at line 904 of file Server.php.

setAcl ( Zend_Acl $  acl)

Set ACL adapter

Parameters:
Zend_Acl$acl
Returns:
Zend_Amf_Server

Definition at line 169 of file Server.php.

Set authentication adapter

Parameters:
Zend_Amf_Auth_Abstract$auth
Returns:
Zend_Amf_Server

Definition at line 148 of file Server.php.

setClass ( class,
namespace = '',
argv = null 
)

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
string$namespaceOptional
mixed$argOptional arguments to pass to a method
Returns:
Zend_Amf_Server
Exceptions:
Zend_Amf_Server_Exceptionon invalid input

Implements Zend_Server_Interface.

Definition at line 726 of file Server.php.

Here is the call graph for this function:

Here is the caller graph for this function:

setClassMap ( asClass,
phpClass 
)

Map ActionScript classes to PHP classes

Parameters:
string$asClass
string$phpClass
Returns:
Zend_Amf_Server

Definition at line 915 of file Server.php.

Here is the call graph for this function:

setPersistence ( mode)

Set server persistence

Unimplemented

Parameters:
mixed$mode
Returns:
void

Implements Zend_Server_Interface.

Definition at line 892 of file Server.php.

setProduction ( flag)

Set production flag

Parameters:
bool$flag
Returns:
Zend_Amf_Server

Definition at line 190 of file Server.php.

setRequest ( request)

Set request object

Parameters:
string | Zend_Amf_Request$request
Returns:
Zend_Amf_Server

Definition at line 644 of file Server.php.

Here is the caller graph for this function:

setResponse ( response)

Public access method to private Zend_Amf_Server_Response reference

Parameters:
string | Zend_Amf_Server_Response$response
Returns:
Zend_Amf_Server

Definition at line 681 of file Server.php.

Here is the caller graph for this function:

setSession ( namespace = 'Zend_Amf')
Parameters:
namespaceof all incoming sessions defaults to Zend_Amf
Returns:
Zend_Amf_Server

Definition at line 210 of file Server.php.

Here is the caller graph for this function:


Field Documentation

$_acl [protected]

Definition at line 133 of file Server.php.

$_auth [protected]

Definition at line 127 of file Server.php.

$_classAllowed = array() [protected]

Definition at line 73 of file Server.php.

$_loader [protected]

Definition at line 79 of file Server.php.

$_methods = array() [protected]

Definition at line 64 of file Server.php.

$_production = true [protected]

Definition at line 84 of file Server.php.

$_request = null [protected]

Definition at line 90 of file Server.php.

$_response [protected]

Definition at line 96 of file Server.php.

$_sesionNamespace = 'zend_amf' [protected]

Definition at line 114 of file Server.php.

$_session = false [protected]

Definition at line 108 of file Server.php.

$_sessionName = 'PHPSESSID' [protected]

Definition at line 120 of file Server.php.

$_table = array() [protected]

Definition at line 102 of file Server.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations