Class Zend_Amf_Parse_Amf3_Deserializer

Description

Read an AMF3 input stream and convert it into PHP data types.

  • copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  • todo: Class could be implemented as Factory Class with each data type it's own class.
  • todo: readObject to handle Typed Objects
  • todo: readXMLStrimg to be implemented.
  • license: New BSD License

Located in /Amf/Parse/Amf3/Deserializer.php (line 40)

Zend_Amf_Parse_Deserializer
   |
   --Zend_Amf_Parse_Amf3_Deserializer
Variable Summary
Method Summary
 array readArray ()
 int|float readInteger ()
 object|array readObject ()
 String readString ()
 mixed readTypeMarker ([integer $typeMarker = null])
 SimpleXml readXmlString ()
Variables
int $_objectCount (line 46)

Total number of objects in the referenceObject array

  • access: protected
array $_referenceDefinitions = array() (line 64)

An array of reference class definitions per body

  • access: protected
array $_referenceObjects = array() (line 52)

An array of reference objects per amf body

  • access: protected
array $_referenceStrings = array() (line 58)

An array of reference strings per amf body

  • access: protected

Inherited Variables

Inherited from Zend_Amf_Parse_Deserializer

Zend_Amf_Parse_Deserializer::$_stream
Methods
readArray (line 240)

Read amf array to PHP array

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

  • access: public
array readArray ()
readDate (line 213)

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 ]

  • access: public
Zend_Date readDate ()
readInteger (line 134)

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 readInteger ()
readObject (line 279)

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
  • access: public
object|array readObject ()
readString (line 176)

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

  • access: public
String readString ()
readTypeMarker (line 77)

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.

  • return: Whatever the corresponding PHP data type is
  • throws: Zend_Amf_Exception for unidentified marker type
  • access: public
mixed readTypeMarker ([integer $typeMarker = null])
  • integer $typeMarker

Redefinition of:
Zend_Amf_Parse_Deserializer::readTypeMarker()
Checks for AMF marker types and calls the appropriate methods for deserializing those marker types. Markers are the data type of the following value.
readXmlString (line 414)

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

  • return: Object
  • access: public
SimpleXml readXmlString ()

Inherited Methods

Inherited From Zend_Amf_Parse_Deserializer

 Zend_Amf_Parse_Deserializer::__construct()
 Zend_Amf_Parse_Deserializer::readTypeMarker()

Documentation generated on Mon, 21 Jun 2010 15:16:48 -0400 by phpDocumentor 1.4.3