Read an AMF0 input stream and convert it into PHP data types

Logic for deserialization of the AMF envelop is based on resources supplied by Adobe Blaze DS. For and example of deserialization please review the BlazeDS source tree.

todo Implement Typed Object Class Mapping
todo Class could be implemented as Factory Class with each data type it's own class
package Zend_Amf
subpackage Parse_Amf0
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License
inherited_from \Zend_Amf_Parse_Deserializer

 Methods

Constructor

__construct(\Zend_Amf_Parse_InputStream $stream) : void
Inherited

Parameters

$stream

\Zend_Amf_Parse_InputStream

Return the object encoding to check if an AMF3 object is going to be return.

getObjectEncoding() : integer

Returns

integer

AMF3 data type encountered load AMF3 Deserializer to handle type markers.

readAmf3TypeMarker() : string

Returns

string

Converts numerically indexed actiosncript arrays into php arrays.

readArray() : array

Called when marker type is 10

Returns

array

Convert AS Date to Zend_Date

readDate() : \Zend_Date

Returns

\Zend_Date

Reads an array with numeric and string indexes.

readMixedArray() : array

Called when marker type is 8

todo As of Flash Player 9 there is not support for mixed typed arrays so we handle this as an object. With the introduction of vectors in Flash Player 10 this may need to be reconsidered.

Returns

array

Read AMF objects and convert to PHP objects

readObject(array|null $object = null) : object

Read the name value pair objects form the php message and convert them to a php object class.

Called when the marker type is 3.

Parameters

$object

arraynull

Returns

object

Read reference objects

readReference() : object

Used to gain access to the private array of reference objects. Called when marker type is 7.

Exceptions

\Zend_Amf_Exception for invalid reference keys

Returns

object

Read AMF markers and dispatch for deserialization

readTypeMarker(integer $typeMarker = null) : mixed

Checks for AMF marker types and calls the appropriate methods for deserializing those marker types. Markers are the data type of the following value.

inherited_from \Zend_Amf_Parse_Deserializer::readTypeMarker()

Parameters

$typeMarker

integer

Exceptions

\Zend_Amf_Exception for invalid type

Returns

mixedwhatever the data type is of the marker in php

Checks for AMF marker types and calls the appropriate methods for deserializing those marker types. Markers are the data type of the following value.

readTypeMarker($markerType = null) : mixed
Inherited

Parameters

$markerType

Returns

mixedWhatever the data type is of the marker in php

Read Class that is to be mapped to a server class.

readTypedObject() : object | array

Commonly used for Value Objects on the server

todo implement Typed Class mapping

Exceptions

\Zend_Amf_Exception if unable to load type

Returns

objectarray

Convert XML to SimpleXml If user wants DomDocument they can use dom_import_simplexml

readXmlString() : \SimpleXml

Returns

\SimpleXmlObject

 Properties

 

If AMF3 serialization occurs, update to AMF0 0x03

$_objectEncoding : integer

Default

\Zend_Amf_Constants::AMF0_OBJECT_ENCODING
 

An array of objects used for recursively deserializing an object.

$_reference : array

Default

array()
 

The raw string that represents the AMF request.

$_stream : \Zend_Amf_Parse_InputStream

Default