Zend Framework
1.12
|
Public Member Functions | |
__construct () | |
The server constructor. | |
setAuth (Zend_Amf_Auth_Abstract $auth) | |
Set authentication adapter. | |
getAuth () | |
Get authentication adapter. | |
setAcl (Zend_Acl $acl) | |
Set ACL adapter. | |
getAcl () | |
Get ACL adapter. | |
setProduction ($flag) | |
Set production flag. | |
isProduction () | |
Whether or not the server is in production. | |
setSession ($namespace= 'Zend_Amf') | |
isSession () | |
Whether of not the server is using sessions. | |
handle ($request=null) | |
Handle an AMF call from the gateway. | |
setRequest ($request) | |
Set request object. | |
getRequest () | |
Return currently registered request object. | |
setResponse ($response) | |
Public access method to private Zend_Amf_Server_Response reference. | |
getResponse () | |
get a reference to the Zend_Amf_response instance | |
setClass ($class, $namespace= '', $argv=null) | |
Attach a class or object to the server. | |
addFunction ($function, $namespace= '') | |
Attach a function to the server. | |
addDirectory ($dir) | |
Creates an array of directories in which services can reside. | |
getDirectory () | |
Returns an array of directories that can hold services. | |
fault ($fault=null, $code=404) | |
Raise a server fault. | |
getFunctions () | |
Returns a list of registered methods. | |
setPersistence ($mode) | |
Set server persistence. | |
loadFunctions ($definition) | |
Load server definition. | |
setClassMap ($asClass, $phpClass) | |
Map ActionScript classes to PHP classes. | |
listMethods () | |
List all available methods. | |
Protected Member Functions | |
_checkAcl ($object, $function) | |
Check if the ACL allows accessing the function or method. | |
getLoader () | |
Get PluginLoader for the Server. | |
_dispatch ($method, $params=null, $source=null) | |
Loads a remote class or method and executes the function and returns the result. | |
_loadCommandMessage (Zend_Amf_Value_Messaging_CommandMessage $message) | |
Handles each of the 11 different command message types. | |
_errorMessage ($objectEncoding, $message, $description, $detail, $code, $line) | |
Create appropriate error message. | |
_handleAuth ($userid, $password) | |
Handle AMF authentication. | |
_handle (Zend_Amf_Request $request) | |
Takes the deserialized AMF request and performs any operations. | |
_buildDispatchTable () | |
(Re)Build the dispatch table | |
_castParameters ($reflectionMethod, array $params) | |
Cast parameters. | |
Protected Attributes | |
$_methods = array() | |
$_classAllowed = array() | |
$_loader | |
$_production = true | |
$_request = null | |
$_response | |
$_table = array() | |
$_session = false | |
$_sesionNamespace = 'zend_amf' | |
$_sessionName = 'PHPSESSID' | |
$_auth | |
$_acl | |
__construct | ( | ) |
The server constructor.
|
protected |
(Re)Build the dispatch table
The dispatch table consists of a an array of method name => Zend_Server_Reflection_Function_Abstract pairs
|
protected |
Cast parameters.
Takes the provided parameters from the request, and attempts to cast them to objects, if the prototype defines any as explicit object types
Reflection | $reflectionMethod | |
array | $params |
|
protected |
Check if the ACL allows accessing the function or method.
string | object | $object | Object or class being accessed |
string | $function | Function or method being accessed |
|
protected |
Loads a remote class or method and executes the function and returns the result.
string | $method | Is the method to execute |
mixed | $param | values for the method |
Zend_Amf_Server_Exception |
|
protected |
Create appropriate error message.
int | $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 |
int | $code | Error code |
int | $line | Error line |
|
protected |
Takes the deserialized AMF request and performs any operations.
should implement and SPL observer pattern for custom AMF headers
DescribeService support
Zend_Amf_Request | $request |
Zend_Amf_server_Exception|Exception |
|
protected |
Handle AMF authentication.
string | $userid | |
string | $password |
|
protected |
Handles each of the 11 different command message types.
A command message is a flex.messaging.messages.CommandMessage
Zend_Amf_Value_Messaging_CommandMessage | $message |
addDirectory | ( | $dir | ) |
Creates an array of directories in which services can reside.
TODO: add support for prefixes?
string | $dir |
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.
string | array | $function | Valid callback |
string | $namespace | Optional namespace prefix |
Zend_Amf_Server_Exception |
Implements Zend_Server_Interface.
fault | ( | $fault = null , |
|
$code = 404 |
|||
) |
Raise a server fault.
Unimplemented
string | Exception | $fault |
Implements Zend_Server_Interface.
getAcl | ( | ) |
Get ACL adapter.
getAuth | ( | ) |
Get authentication adapter.
getDirectory | ( | ) |
Returns an array of directories that can hold services.
getFunctions | ( | ) |
Returns a list of registered methods.
Returns an array of dispatchables (Zend_Server_Reflection_Function, _Method, and _Class items).
Implements Zend_Server_Interface.
|
protected |
Get PluginLoader for the Server.
getRequest | ( | ) |
Return currently registered request object.
getResponse | ( | ) |
get a reference to the Zend_Amf_response instance
handle | ( | $request = null | ) |
Handle an AMF call from the gateway.
null | Zend_Amf_Request | $request | Optional |
Implements Zend_Server_Interface.
isProduction | ( | ) |
Whether or not the server is in production.
isSession | ( | ) |
Whether of not the server is using sessions.
listMethods | ( | ) |
List all available methods.
Returns an array of method names.
loadFunctions | ( | $definition | ) |
Load server definition.
Unimplemented
array | $definition |
Implements Zend_Server_Interface.
setAcl | ( | Zend_Acl | $acl | ) |
setAuth | ( | Zend_Amf_Auth_Abstract | $auth | ) |
Set authentication adapter.
If the authentication adapter implements a "getAcl()" method, populate the ACL of this instance with it (if none exists already).
Zend_Amf_Auth_Abstract | $auth |
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.
string | object | $class | |
string | $namespace | Optional |
mixed | $arg | Optional arguments to pass to a method |
Zend_Amf_Server_Exception | on invalid input |
Implements Zend_Server_Interface.
setClassMap | ( | $asClass, | |
$phpClass | |||
) |
Map ActionScript classes to PHP classes.
string | $asClass | |
string | $phpClass |
setPersistence | ( | $mode | ) |
Set server persistence.
Unimplemented
mixed | $mode |
Implements Zend_Server_Interface.
setProduction | ( | $flag | ) |
setRequest | ( | $request | ) |
setResponse | ( | $response | ) |
Public access method to private Zend_Amf_Server_Response reference.
string | Zend_Amf_Server_Response | $response |
setSession | ( | $namespace = 'Zend_Amf' | ) |
namespace | of all incoming sessions defaults to Zend_Amf |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |