Zend Framework  1.12
Public Member Functions | Protected Attributes | List of all members
Zend_Amf_Parse_Amf3_Deserializer Class Reference

Public Member Functions

 readTypeMarker ($typeMarker=null)
 Read AMF markers and dispatch for deserialization.
 
 readInteger ()
 Read and deserialize an integer.
 
 readString ()
 Read and deserialize a string.
 
 readDate ()
 Read and deserialize a date.
 
 readArray ()
 Read amf array to PHP array.
 
 readObject ()
 Read an object from the AMF stream and convert it into a PHP object.
 
 readXmlString ()
 Convert XML to SimpleXml If user wants DomDocument they can use dom_import_simplexml.
 
- Public Member Functions inherited from Zend_Amf_Parse_Deserializer
 __construct (Zend_Amf_Parse_InputStream $stream)
 Constructor.
 
 readTypeMarker ($markerType=null)
 Checks for AMF marker types and calls the appropriate methods for deserializing those marker types.
 

Protected Attributes

 $_objectCount
 
 $_referenceObjects = array()
 
 $_referenceStrings = array()
 
 $_referenceDefinitions = array()
 
- Protected Attributes inherited from Zend_Amf_Parse_Deserializer
 $_stream
 

Member Function Documentation

readArray ( )

Read amf array to PHP array.

  • array = 0x09 integer-data ( [ 1OCTET *amf3-data ] | [OCTET *amf3-data 1] | [ OCTET *amf-data ] )
Returns
array
readDate ( )

Read and deserialize a 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.

  • date = 0x08 integer-data [ number-data ]
Returns
Zend_Date
readInteger ( )

Read and deserialize an integer.

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.

  • 0x00000000 - 0x0000007F : 0xxxxxxx
  • 0x00000080 - 0x00003FFF : 1xxxxxxx 0xxxxxxx
  • 0x00004000 - 0x001FFFFF : 1xxxxxxx 1xxxxxxx 0xxxxxxx
  • 0x00200000 - 0x3FFFFFFF : 1xxxxxxx 1xxxxxxx 1xxxxxxx xxxxxxxx
  • 0x40000000 - 0xFFFFFFFF : throw range exception

0x04 -> integer type code, followed by up to 4 bytes of data.

Parsing integers on OSFlash for the AMF3 integer data format: int|float

readObject ( )

Read an object from the AMF stream and convert it into a PHP object.

Todo:
Rather than using an array of traitsInfo create Zend_Amf_Value_TraitsInfo
Returns
object|array
readString ( )

Read and deserialize a 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 = 0x06 string-data
  • string-data = integer-data [ modified-utf-8 ]
  • modified-utf-8 = *OCTET
Returns
String
readTypeMarker (   $typeMarker = null)

Read 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.

Parameters
integer$typeMarker
Returns
mixed Whatever the corresponding PHP data type is
Exceptions
Zend_Amf_Exceptionfor unidentified marker type
readXmlString ( )

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

Returns
SimpleXml Object

Member Data Documentation

$_objectCount
protected
$_referenceDefinitions = array()
protected
$_referenceObjects = array()
protected
$_referenceStrings = array()
protected