Read an AMF3 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 | readObject to handle Typed Objects |
---|---|
todo | readXMLStrimg to be implemented. |
todo | Class could be implemented as Factory Class with each data type it's own class. |
package | Zend_Amf |
subpackage | Parse_Amf3 |
copyright | Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
license | New BSD License |
inherited_from | \Zend_Amf_Parse_Deserializer |
__construct(\Zend_Amf_Parse_InputStream $stream) : void
\Zend_Amf_Parse_InputStream
readArray() : array
array
readDate() : \Zend_Date
Data is the number of milliseconds elapsed since the epoch of midnight, 1st Jan 1970 in the UTC time zone. Local time zone information is not sent to flash.
\Zend_Date
readInteger() : integer | float
AMF 3 represents smaller integers with fewer bytes using the most significant bit of each byte. The worst case uses 32-bits to represent a 29-bit number, which is what we would have done with no compression.
0x04 -> integer type code, followed by up to 4 bytes of data.
Parsing integers on OSFlash for the AMF3 integer data format:
link | http://osflash.org/amf3/parsing_integers |
---|
integer
float
readObject() : object | array
todo | Rather than using an array of traitsInfo create Zend_Amf_Value_TraitsInfo |
---|
object
array
readString() : String
Strings can be sent as a reference to a previously occurring String by using an index to the implicit string reference table. Strings are encoding using UTF-8 - however the header may either describe a string literal or a string reference.
String
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() |
---|
integer
\Zend_Amf_Exception |
for unidentified marker type |
---|
mixed
Whatever the corresponding PHP data type isreadTypeMarker($markerType = null
) : mixed
mixed
Whatever the data type is of the marker in phpreadXmlString() : \SimpleXml
\SimpleXml
Object$_objectCount : integer
$_referenceDefinitions : array
array()
$_referenceObjects : array
array()
$_referenceStrings : array
array()
$_stream : \Zend_Amf_Parse_InputStream