Amf/Server.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled
with this package in the file LICENSE.txt.
It is also available through the world-wide-web at this URL:
http://framework.zend.com/license/new-bsd
If you did not receive a copy of the license and are unable to
obtain it through the world-wide-web, please send an email
to license@zend.com so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Amf
- Version
- $Id$
Package: Zend_Amf\ServerAn AMF gateway server implementation to allow the connection of the Adobe Flash Player to
Zend Framework
- Implements
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Todo
- Make the reflection methods cache and autoload.
Properties



array $_classAllowed = array()Array of classes that can be called without being explicitly loaded
Keys are class names.
Default valuearray()Details- Type
- array



bool $_production = trueProduction flag; whether or not to return exception messages
Default valuetrueDetails- Type
- bool



bool $_session = falsesession flag; whether or not to add a session to each response.
Default valuefalseDetails- Type
- bool



string $_sessionName = 'PHPSESSID'Set the default session.name if php_
Default value'PHPSESSID'Details- Type
- string



array $_table = array()Dispatch table of name => method pairs
Default valuearray()Details- Type
- array
Methods



_buildDispatchTable() : void(Re)Build the dispatch table
The dispatch table consists of a an array of method name =>
Zend_Server_Reflection_Function_Abstract pairs



_checkAcl(string | object $object, string $function) : \unknown_typeCheck if the ACL allows accessing the function or method
Parameters| Name | Type | Description |
|---|
| $object | string | object | Object or class being accessed |
|---|
| $function | string | Function or method being accessed |
|---|
Returns 


_dispatch(string $method, $params = null, $source = null) : mixedLoads a remote class or method and executes the function and returns
the result
Parameters| Name | Type | Description |
|---|
| $method | string | Is the method to execute |
|---|
| $params | | |
|---|
| $source | | |
|---|
Returns| Type | Description |
|---|
| mixed | $response the result of executing the method |
Throws 


_errorMessage(int $objectEncoding, string $message, string $description, mixed $detail, int $code, int $line) : \Zend_Amf_Value_Messaging_ErrorMessage | arrayCreate appropriate error message
Parameters| Name | Type | Description |
|---|
| $objectEncoding | int | Current AMF encoding |
|---|
| $message | string | Message that was being processed when error happened |
|---|
| $description | string | Error description |
|---|
| $detail | mixed | Detailed data about the error |
|---|
| $code | int | Error code |
|---|
| $line | int | Error line |
|---|
Returns 


_handle(\Zend_Amf_Request $request) : \Zend_Amf_ResponseTakes the deserialized AMF request and performs any operations.
ParametersReturnsThrowsDetails- Todo
- should implement and SPL observer pattern for custom AMF headers
- Todo
- DescribeService support



_handleAuth(string $userid, string $password) : booleanHandle AMF authentication
Parameters| Name | Type | Description |
|---|
| $userid | string | |
|---|
| $password | string | |
|---|
Returns 


addDirectory(string $dir) : voidCreates an array of directories in which services can reside.
TODO: add support for prefixes?
Parameters| Name | Type | Description |
|---|
| $dir | string | |
|---|



addFunction(string | array $function, string $namespace = '') : \Zend_Amf_ServerAttach 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| Name | Type | Description |
|---|
| $function | string | array | Valid callback |
|---|
| $namespace | string | Optional namespace prefix |
|---|
ReturnsThrows


getFunctions() : arrayReturns a list of registered methods
Returns an array of dispatchables (Zend_Server_Reflection_Function,
_Method, and _Class items).
Returns


listMethods() : arrayList all available methods
Returns an array of method names.
Returns


setAuth(\Zend_Amf_Auth_Abstract $auth) : \Zend_Amf_ServerSet authentication adapter
If the authentication adapter implements a "getAcl()" method, populate
the ACL of this instance with it (if none exists already).
ParametersReturns


setClass(string | object $class, string $namespace = '', $argv = null) : \Zend_Amf_ServerAttach 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| Name | Type | Description |
|---|
| $class | string | object | |
|---|
| $namespace | string | Optional |
|---|
| $argv | | |
|---|
ReturnsThrows


setClassMap(string $asClass, string $phpClass) : \Zend_Amf_ServerMap ActionScript classes to PHP classes
Parameters| Name | Type | Description |
|---|
| $asClass | string | |
|---|
| $phpClass | string | |
|---|
Returns