API Documentation

Zend/Amf/Parse/Amf3/Deserializer.php

Show: inherited
Table of Contents

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 license@zend.com 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_Amf3  
Version
$Id: Deserializer.php 24594 2012-01-05 21:27:01Z matthew $  

\Zend_Amf_Parse_Amf3_Deserializer

Package: Zend\Amf\Parse\Amf3

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

Parent(s)
\Zend_Amf_Parse_Deserializer
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
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.  

Properties

Propertyprotectedint  $_objectCount= ''

Total number of objects in the referenceObject array

Details
Type
int
Propertyprotectedarray  $_referenceDefinitions= 'array()'

An array of reference class definitions per body

Default valuearray()Details
Type
array
Propertyprotectedarray  $_referenceObjects= 'array()'

An array of reference objects per amf body

Default valuearray()Details
Type
array
Propertyprotectedarray  $_referenceStrings= 'array()'

An array of reference strings per amf body

Default valuearray()Details
Type
array

Methods

methodpublicreadArray( ) : array

Read amf array to PHP array

  • array = 0x09 integer-data ( [ 1OCTET *amf3-data ] | [OCTET *amf3-data 1] | [ OCTET *amf-data ] )
Returns
Type Description
array
methodpublicreadDate( ) : \Zend_Date

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
Type Description
\Zend_Date
methodpublicreadInteger( ) : int|float

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:

Returns
Type Description
int|float
Details
Link
http://osflash.org/amf3/parsing_integers  
methodpublicreadObject( ) : object|array

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

Returns
Type Description
object|array
Details
Todo
Rather than using an array of traitsInfo create Zend_Amf_Value_TraitsInfo  
methodpublicreadString( ) : String

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
Type Description
String
methodpublicreadTypeMarker( integer $typeMarker = null ) : mixed

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
Name Type Description
$typeMarker integer
Returns
Type Description
mixed Whatever the corresponding PHP data type is
Throws
Exception Description
\Zend_Amf_Exception for unidentified marker type
methodpublicreadXmlString( ) : \SimpleXml

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

Returns
Type Description
\SimpleXml Object
Documentation was generated by DocBlox 0.15.1.