Class Amfphp_Core_Amf_Deserializer

Description

Amfphp_Core_Amf_Deserializer takes the raw amf input stream and converts it PHP objects representing the data.

Located in /Amfphp/Core/Amf/Deserializer.php (line 19)


	
			
Direct descendents
Class Description
AmfDeserializerWrapper This class exports some internal (public) methods. This way, those methods can be tested separately.
Variable Summary
Method Summary
Amfphp_Core_Amf_Deserializer __construct ( $raw)
void deserialize (object $amfdata)
void readAmf3Array ()
mixed readAmf3Data ()
void readAmf3Date ()
read readAmf3Int ()
Object readAmf3Object ()
string readAmf3String ()
array readArray ()
void readBuffer ( $len)
int readByte ()
object The readCustomClass ()
mixed readData (mixed $type)
long readDate ()
float readDouble ()
void readHeaders ()
int readInt ()
int readLong ()
string readLongUTF ()
void readMessages ()
array readMixedArray ()
array readMixedObject ()
Object readObject ()
String readReference ()
string readUTF ()
void resetReferences ()
Variables
mixed $amf0storedObjects (line 60)
  • access: protected
int $currentByte (line 37)

The current seek cursor of the stream

  • access: protected
$deserializedPacket (line 51)

the Packet contained in the serialized data

  • access: protected
int $headersLeftToProcess (line 45)

The number of headers in the packet left to process

  • access: protected
int $messagesLeftToProcess (line 29)

The number of Messages in the packet left to process

  • access: protected
mixed $meta (line 56)

metaInfo

  • access: protected
mixed $rawData (line 21)
  • access: protected
mixed $storedDefinitions (line 59)
  • access: protected
mixed $storedObjects (line 58)
  • access: protected
mixed $storedStrings (line 57)
  • access: protected
Methods
Constructor __construct (line 62)
  • access: public
Amfphp_Core_Amf_Deserializer __construct ( $raw)
  • $raw
deserialize (line 73)

deserialize invokes this class to transform the raw data into valid object

  • access: public
void deserialize (object $amfdata)
  • object $amfdata: The object to put the deserialized data in
readAmf3Array (line 551)
  • access: protected
void readAmf3Array ()

Redefined in descendants as:
readAmf3ByteArray (line 538)
  • access: protected
void readAmf3ByteArray ()

Redefined in descendants as:
readAmf3Data (line 383)

read the type byte, then call the corresponding amf3 data reading function

  • access: public
mixed readAmf3Data ()

Redefined in descendants as:
readAmf3Date (line 459)
  • access: protected
void readAmf3Date ()
readAmf3Int (line 426)

Handle decoding of the variable-length representation which gives seven bits of value per serialized byte by using the high-order bit of each byte as a continuation flag.

  • return: integer value
  • access: protected
read readAmf3Int ()
readAmf3Object (line 580)

this probably needs some refactoring. Leave as is for now... A.S.

  • access: protected
Object readAmf3Object ()

Redefined in descendants as:
readAmf3String (line 482)

readString

  • access: protected
string readAmf3String ()

Redefined in descendants as:
readAmf3Xml (line 508)
  • access: protected
Amfphp_Core_Amf_Types_Xml readAmf3Xml ()
readAmf3XmlDocument (line 525)
  • access: protected
Amfphp_Core_Amf_Types_Xml readAmf3XmlDocument ()
readArray (line 310)

readArray turns an all numeric keyed actionscript array into a php array.

  • return: The php array
  • access: protected
array readArray ()

Redefined in descendants as:
readBuffer (line 669)

Taken from SabreAmf

  • access: protected
void readBuffer ( $len)
  • $len
readByte (line 169)

readByte grabs the next byte from the data stream and returns it.

  • return: The next byte converted into an integer
  • access: protected
int readByte ()

Redefined in descendants as:
readCustomClass (line 364)

readCustomClass reads the amf content associated with a class instance which was registered with Object.registerClass. In order to preserve the class name an additional property is assigned to the object Amfphp_Core_Amf_Constants::FIELD_EXPLICIT_TYPE. This property will be overwritten if it existed within the class already.

  • return: php representation of the object
  • access: protected
object The readCustomClass ()
readData (line 180)

readData is the main switch for mapping a type code to an actual implementation for deciphering it.

  • return: The php version of the data in the Packet block
  • access: public
mixed readData (mixed $type)
  • mixed $type: The $type integer
readDate (line 327)

readDate reads a date from the amf Packet and returns the time in ms.

This method is still under development.

  • return: The date in ms.
  • access: protected
long readDate ()

Redefined in descendants as:
readDouble (line 232)

readDouble reads the floating point value from the bytes stream and properly orders the bytes depending on the system architecture.

  • return: The floating point value of the next 8 bytes
  • access: protected
float readDouble ()

Redefined in descendants as:
readHeaders (line 92)

readHeaders converts that header section of the amf Packet into php obects.

Header information typically contains meta data about the Packet.

  • access: protected
void readHeaders ()
readInt (line 140)

readInt grabs the next 2 bytes and returns the next two bytes, shifted and combined to produce the resulting integer

  • return: The resulting integer from the next 2 bytes
  • access: protected
int readInt ()

Redefined in descendants as:
readLong (line 659)

readLong grabs the next 4 bytes shifts and combines them to produce an integer

  • return: The resulting integer from the next 4 bytes
  • access: protected
int readLong ()

Redefined in descendants as:
readLongUTF (line 349)

readLongUTF first grabs the next 4 bytes which represent the string length.

Then it grabs the next (len) bytes of the resulting in the string

  • return: The utf8 decoded string
  • access: protected
string readLongUTF ()
readMessages (line 118)
  • access: protected
void readMessages ()
readMixedArray (line 278)

readMixedArray turns an array with numeric and string indexes into a php array

  • return: The php array with mixed indexes
  • access: protected
array readMixedArray ()

Redefined in descendants as:
readMixedObject (line 290)

readMixedObject reads the name/value properties of the amf Packet and converts numeric looking keys to numeric keys

  • return: The php array with the object data
  • access: protected
array readMixedObject ()
readObject (line 248)

readObject reads the name/value properties of the amf Packet and converts them into their equivilent php representation

  • return: The php object filled with the data
  • access: protected
Object readObject ()

Redefined in descendants as:
readReference (line 268)

readReference replaces the old readFlushedSO. It treats where there

are references to other objects. Currently it does not resolve the object as this would involve a serious amount of overhead, unless you have a genius idea

  • access: protected
String readReference ()

Redefined in descendants as:
readUTF (line 151)

readUTF first grabs the next 2 bytes which represent the string length.

Then it grabs the next (len) bytes of the resulting string.

  • return: The utf8 decoded string
  • access: protected
string readUTF ()
readXml (line 338)
  • access: protected
resetReferences (line 80)
  • access: protected
void resetReferences ()

Documentation generated on Mon, 23 Jan 2012 17:22:04 -0300 by phpDocumentor 1.4.3