Amf/Parse/Amf0/Deserializer.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 [email protected] so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Amf
- Subpackage
- Parse_Amf0
- Version
- $Id: Deserializer.php 24593 2012-01-05 20:35:02Z matthew $
\Zend_Amf_Parse_Amf0_Deserializer
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.
- Parent(s)
- \Zend_Amf_Parse_Deserializer
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Todo
- Implement Typed Object Class Mapping
- Todo
- Class could be implemented as Factory Class with each data type it's own class
Properties

int $_objectEncoding = \Zend_Amf_Constants::AMF0_OBJECT_ENCODINGIf AMF3 serialization occurs, update to AMF0 0x03
\Zend_Amf_Constants::AMF0_OBJECT_ENCODINGDetails- Type
- int

array $_reference = array()An array of objects used for recursively deserializing an object.
array()Details- Type
- array

\Zend_Amf_Parse_InputStream $_stream = The raw string that represents the AMF request.
Inherited from: \Zend_Amf_Parse_Deserializer::$$_stream- Type
- \Zend_Amf_Parse_InputStream
- Inherited_from
- \Zend_Amf_Parse_Deserializer::$$_stream
Methods

__construct(\Zend_Amf_Parse_InputStream $stream) : void
| Name | Type | Description |
|---|---|---|
| $stream | \Zend_Amf_Parse_InputStream |

getObjectEncoding() : intReturn the object encoding to check if an AMF3 object is going to be return.
| Type | Description |
|---|---|
| int |

readAmf3TypeMarker() : stringAMF3 data type encountered load AMF3 Deserializer to handle type markers.
| Type | Description |
|---|---|
| string |

readArray() : arrayConverts numerically indexed actiosncript arrays into php arrays.
Called when marker type is 10
| Type | Description |
|---|---|
| array |

readMixedArray() : arrayReads an array with numeric and string indexes.
Called when marker type is 8
| Type | Description |
|---|---|
| array |
- 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.

readObject(array | null $object = null) : objectRead AMF objects and convert to PHP objects
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.
| Name | Type | Description |
|---|---|---|
| $object | array | null |
| Type | Description |
|---|---|
| object |

readReference() : objectRead reference objects
Used to gain access to the private array of reference objects. Called when marker type is 7.
| Type | Description |
|---|---|
| object |
| Exception | Description |
|---|---|
| \Zend_Amf_Exception | for invalid reference keys |

readTypeMarker(integer $typeMarker = null) : mixedRead AMF markers and dispatch for deserialization
Checks for AMF marker types and calls the appropriate methods for deserializing those marker types. Markers are the data type of the following value.
| Name | Type | Description |
|---|---|---|
| $typeMarker | integer |
| Type | Description |
|---|---|
| mixed | whatever the data type is of the marker in php |
| Exception | Description |
|---|---|
| \Zend_Amf_Exception | for invalid type |

readTypedObject() : object | arrayRead Class that is to be mapped to a server class.
Commonly used for Value Objects on the server
| Type | Description |
|---|---|
| object | array |
| Exception | Description |
|---|---|
| \Zend_Amf_Exception | if unable to load type |
- Todo
- implement Typed Class mapping