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 ()
void 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 ()
Variables
mixed $amf0storedObjects (line 61)
  • 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 60)
  • access: protected
mixed $storedObjects (line 59)
  • access: protected
mixed $storedStrings (line 58)
  • access: protected
Methods
Constructor __construct (line 63)
  • access: public
Amfphp_Core_Amf_Deserializer __construct ( $raw)
  • $raw
deserialize (line 79)

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 596)
  • access: protected
void readAmf3Array ()

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

Redefined in descendants as:
readAmf3Data (line 419)
  • access: public
void readAmf3Data ()

Redefined in descendants as:
readAmf3Date (line 506)
  • access: protected
void readAmf3Date ()
readAmf3Int (line 464)

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 631)

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

  • access: protected
Object readAmf3Object ()

Redefined in descendants as:
readAmf3String (line 534)

readString

  • access: protected
string readAmf3String ()

Redefined in descendants as:
readAmf3XmlString (line 562)
  • access: protected
void readAmf3XmlString ()
readArray (line 338)

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 732)

Taken from SabreAmf

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

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 402)

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 200)

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 358)

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 251)

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 95)

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 154)

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 720)

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 386)

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 123)
  • access: protected
void readMessages ()
readMixedArray (line 302)

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 315)

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 269)

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 291)

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 166)

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 ()

Documentation generated on Thu, 24 Mar 2011 16:55:39 +0100 by phpDocumentor 1.4.3