API Documentation

Amf/Server.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Amf
version
$Id: Server.php 21210 2010-02-27 10:37:39Z yoshida@zend.co.jp $
Classes
Zend_Amf_Server

Description

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.

Zend_Amf_Server

Implements
Zend_Server_Interface
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Amf
subpackage
Server
todo
Make the reflection methods cache and autoload.
Properties
$_methods
$_classAllowed
$_loader
$_production
$_request
$_response
$_table
$_session
$_sesionNamespace
$_sessionName
$_auth
$_acl
Methods
__construct
setAuth
getAuth
setAcl
getAcl
setProduction
isProduction
setSession
isSession
_checkAcl
getLoader
_dispatch
_loadCommandMessage
_errorMessage
_handleAuth
_handle
handle
setRequest
getRequest
setResponse
getResponse
setClass
addFunction
addDirectory
getDirectory
_buildDispatchTable
fault
getFunctions
setPersistence
loadFunctions
setClassMap
listMethods

Description

An AMF gateway server implementation to allow the connection of the Adobe Flash Player to Zend Framework

Properties

$_acl

Zend_Acl $_acl = ''

ACL handler object

Details

$_acl
Zend_Acl
visibility
protected
default
final
false
static
false

$_auth

Zend_Amf_Auth_Abstract $_auth = ''

Authentication handler object

Details

$_auth
Zend_Amf_Auth_Abstract
visibility
protected
default
final
false
static
false

$_classAllowed

array $_classAllowed = 'array'

Array of classes that can be called without being explicitly loaded

Keys are class names.

Details

$_classAllowed
array
visibility
protected
default
array
final
false
static
false

$_loader

Zend_Loader_PluginLoader $_loader = ''

Loader for classes in added directories

Details

$_loader
Zend_Loader_PluginLoader
visibility
protected
default
final
false
static
false

$_methods

array $_methods = 'array'

Array of dispatchables

Details

$_methods
array
visibility
protected
default
array
final
false
static
false

$_production

bool $_production = 'true'

Details

$_production
bool
Production flag; whether or not to return exception messages
visibility
protected
default
true
final
false
static
false

$_request

null|Zend_Amf_Request $_request = 'null'

Request processed

Details

$_request
null|Zend_Amf_Request
visibility
protected
default
null
final
false
static
false

$_response

null|Zend_Amf_Response $_response = ''

Class to use for responses

Details

$_response
null|Zend_Amf_Response
visibility
protected
default
final
false
static
false

$_sesionNamespace

Zend_Session_NameSpace $_sesionNamespace = 'zend_amf'

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

Details

$_sesionNamespace
Zend_Session_NameSpace
default session namespace zend_amf
visibility
protected
default
zend_amf
final
false
static
false

$_session

bool $_session = 'false'

Details

$_session
bool
session flag; whether or not to add a session to each response.
visibility
protected
default
false
final
false
static
false

$_sessionName

string $_sessionName = 'PHPSESSID'

Set the default session.name if php_

Details

$_sessionName
string
visibility
protected
default
PHPSESSID
final
false
static
false

$_table

array $_table = 'array'

Dispatch table of name => method pairs

Details

$_table
array
visibility
protected
default
array
final
false
static
false

Methods

__construct

__construct( ) :

The server constructor

Details
visibility
public
final
false
static
false

_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

Details
visibility
protected
final
false
static
false

_checkAcl

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

Check if the ACL allows accessing the function or method

Arguments
$object
stringobject
Object or class being accessed
$function
string
Function or method being accessed
Output
unknown_type
Details
visibility
protected
final
false
static
false

_dispatch

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

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

Arguments
$method
string
Is the method to execute
$params
$source
Output
mixed
$response the result of executing the method
Details
visibility
protected
final
false
static
false
throws

_errorMessage

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

Create appropriate error message

Arguments
$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
Details
visibility
protected
final
false
static
false

_handle

_handle( Zend_Amf_Request $request ) : Zend_Amf_Response

Takes the deserialized AMF request and performs any operations.

Arguments
$request
Zend_Amf_Request
Details
visibility
protected
final
false
static
false
throws
todo
should implement and SPL observer pattern for custom AMF headers
todo
DescribeService support

_handleAuth

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

Handle AMF authentication

Arguments
$userid
string
$password
string
Output
boolean
Details
visibility
protected
final
false
static
false

_loadCommandMessage

_loadCommandMessage( Zend_Amf_Value_Messaging_CommandMessage $message ) : Zend_Amf_Value_Messaging_AcknowledgeMessage

Handles each of the 11 different command message types.

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

Arguments
$message
Zend_Amf_Value_Messaging_CommandMessage
Details
visibility
protected
final
false
static
false
see
Zend_Amf_Value_Messaging_CommandMessage

addDirectory

addDirectory( string $dir ) :

Creates an array of directories in which services can reside.

TODO: add support for prefixes?

Arguments
$dir
string
Details
visibility
public
final
false
static
false

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.

Arguments
$function
stringarray
Valid callback
$namespace
string
Optional namespace prefix
Details
visibility
public
final
false
static
false
throws

fault

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

Raise a server fault

Unimplemented

Arguments
$fault
stringException
$code
Details
visibility
public
final
false
static
false

getAcl

getAcl( ) : Zend_Acl

Get ACL adapter

Output
Zend_Acl
Details
visibility
public
final
false
static
false

getAuth

getAuth( ) : Zend_Amf_Auth_Abstract

Get authentication adapter

Details
visibility
public
final
false
static
false

getDirectory

getDirectory( ) : array

Returns an array of directories that can hold services.

Output
array
Details
visibility
public
final
false
static
false

getFunctions

getFunctions( ) : array

Returns a list of registered methods

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

Output
array
Details
visibility
public
final
false
static
false

getLoader

getLoader( ) : Zend_Loader_PluginLoader

Get PluginLoader for the Server

Details
visibility
protected
final
false
static
false

getRequest

getRequest( ) : null|Zend_Amf_Request

Return currently registered request object

Output
null|Zend_Amf_Request
Details
visibility
public
final
false
static
false

getResponse

getResponse( ) : Zend_Amf_Server_Response

get a reference to the Zend_Amf_response instance

Output
Zend_Amf_Server_Response
Details
visibility
public
final
false
static
false

handle

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

Handle an AMF call from the gateway.

Arguments
$request
nullZend_Amf_Request
Optional
Details
visibility
public
final
false
static
false

isProduction

isProduction( ) : bool

Whether or not the server is in production

Output
bool
Details
visibility
public
final
false
static
false

isSession

isSession( ) : bool

Whether of not the server is using sessions

Output
bool
Details
visibility
public
final
false
static
false

listMethods

listMethods( ) : array

List all available methods

Returns an array of method names.

Output
array
Details
visibility
public
final
false
static
false

loadFunctions

loadFunctions( array $definition ) : void

Load server definition

Unimplemented

Arguments
$definition
array
Details
visibility
public
final
false
static
false

setAcl

setAcl( Zend_Acl $acl ) : Zend_Amf_Server

Set ACL adapter

Arguments
$acl
Zend_Acl
Details
visibility
public
final
false
static
false

setAuth

setAuth( Zend_Amf_Auth_Abstract $auth ) : Zend_Amf_Server

Set authentication adapter

Arguments
$auth
Zend_Amf_Auth_Abstract
Details
visibility
public
final
false
static
false

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.

Arguments
$class
stringobject
$namespace
string
Optional
$argv
Details
visibility
public
final
false
static
false
throws
on invalid input

setClassMap

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

Map ActionScript classes to PHP classes

Arguments
$asClass
string
$phpClass
string
Details
visibility
public
final
false
static
false

setPersistence

setPersistence( mixed $mode ) : void

Set server persistence

Unimplemented

Arguments
$mode
mixed
Details
visibility
public
final
false
static
false

setProduction

setProduction( bool $flag ) : Zend_Amf_Server

Set production flag

Arguments
$flag
bool
Details
visibility
public
final
false
static
false

setRequest

setRequest( string|Zend_Amf_Request $request ) : Zend_Amf_Server

Set request object

Arguments
$request
stringZend_Amf_Request
Details
visibility
public
final
false
static
false

setResponse

setResponse( string|Zend_Amf_Server_Response $response ) : Zend_Amf_Server

Public access method to private Zend_Amf_Server_Response reference

Arguments
$response
stringZend_Amf_Server_Response
Details
visibility
public
final
false
static
false

setSession

setSession( default $namespace = Zend_Amf ) : Zend_Amf_Server

Arguments
$namespace
default
of all incoming sessions defaults to Zend_Amf
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.