PHP Class Amfphp_Core_Amf_Deserializer, amfphp-2.0

Afficher le fichier Open project: silexlabs/amfphp-2.0 Class Usage Examples

Méthodes publiques

Свойство Type Description
$voConverter Amfphp_Core_Common_IVoConverter converts VOs directly if set, rather than instanciating anonymous classes that are converted later

Protected Properties

Свойство Type Description
$amf0storedObjects array objects stored for tracking references(amf0)
$currentByte integer The current seek cursor of the stream note: must be initialised here to avoid error 'String offset cast occured'
$deserializedPacket the Packet contained in the serialized data
$headersLeftToProcess integer The number of headers in the packet left to process
$messagesLeftToProcess integer The number of Messages in the packet left to process
$rawData string data to deserialize
$storedDefinitions array class definitions(traits) stored for tracking references(amf3)
$storedObjects array objects stored for tracking references(amf3)
$storedStrings array strings stored for tracking references(amf3)

Méthodes publiques

Méthode Description
deserialize ( array $getData, array $postData, string $rawPostData ) : Amfphp_Core_Amf_Packet convert from text/binary to php object
readAmf3Data ( ) : mixed read the type byte, then call the corresponding amf3 data reading function
readData ( mixed $type ) : mixed readData is the main switch for mapping a type code to an actual implementation for deciphering it.

Méthodes protégées

Méthode Description
readAmf3Array ( ) : array read amf 3 array
readAmf3ByteArray ( ) : Amfphp_Core_Amf_Types_ByteArray read Amf 3 byte array
readAmf3Date ( ) : boolean | Amfphp_Core_Amf_Types_Date read amf 3 date
readAmf3Int ( ) : read 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.
readAmf3Object ( ) : mixed read amf 3 object
readAmf3String ( ) : string readString
readAmf3Vector ( $type ) : array Reads a vector array of objects from the AMF stream. This works for all vector arrays: vector-object, vector-int vector-uint and vector-double. The Vector is cast to a PHP array. Please note that because of the way php handles integers, uints have to be cast as floats. See {@link http://php.net/manual/en/language.types.integer.php}
readAmf3VectorValue ( $length, $format ) : Read numeric values from the AMF byte stream. Please be aware that unsigned integers are not really supported in PHP, and for this reason unsigned integers are cast to float. {@link http://php.net/manual/en/language.types.integer.php}.
readAmf3Xml ( ) : Amfphp_Core_Amf_Types_Xml read amf 3 xml
readAmf3XmlDocument ( ) : Amfphp_Core_Amf_Types_Xml read amf 3 xml doc
readArray ( ) : array readArray turns an all numeric keyed actionscript array into a php array.
readBuffer ( type $len ) : mixed read some data and move pointer
readByte ( ) : integer readByte grabs the next byte from the data stream and returns it.
readCustomClass ( ) : object readCustomClass reads the amf content associated with a class instance which was registered with Object.registerClass.
readDate ( ) : Amfphp_Core_Amf_Types_Date readDate reads a date from the amf Packet and returns the time in ms.
readDouble ( ) : float readDouble reads the floating point value from the bytes stream and properly orders the bytes depending on the system architecture.
readHeaders ( ) readHeaders converts that header section of the amf Packet into php obects.
readInt ( ) : integer readInt grabs the next 2 bytes and returns the next two bytes, shifted and combined to produce the resulting integer
readLong ( ) : integer readLong grabs the next 4 bytes shifts and combines them to produce an integer
readLongUTF ( ) : string readLongUTF first grabs the next 4 bytes which represent the string length.
readMessages ( ) read messages in AMF packet
readMixedArray ( ) : array readMixedArray turns an array with numeric and string indexes into a php array
readMixedObject ( ) : array readMixedObject reads the name/value properties of the amf Packet and converts numeric looking keys to numeric keys
readObject ( ) : Object readObject reads the name/value properties of the amf Packet and converts them into their equivilent php representation
readReference ( ) : String 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
readUTF ( ) : string readUTF first grabs the next 2 bytes which represent the string length.
readXml ( ) : Amfphp_Core_Amf_Types_Xml read xml
resetReferences ( ) reset reference stores
resolveType ( type $typeIdentifier ) : stdClass tries to use the type to get a typed object. If not possible, return a stdClass, with the explicit type marker set if the type was not just an empty string

Method Details

deserialize() public méthode

convert from text/binary to php object
public deserialize ( array $getData, array $postData, string $rawPostData ) : Amfphp_Core_Amf_Packet
$getData array
$postData array
$rawPostData string
Résultat Amfphp_Core_Amf_Packet

readAmf3Array() protected méthode

read amf 3 array
protected readAmf3Array ( ) : array
Résultat array

readAmf3ByteArray() protected méthode

read Amf 3 byte array
protected readAmf3ByteArray ( ) : Amfphp_Core_Amf_Types_ByteArray
Résultat Amfphp_Core_Amf_Types_ByteArray

readAmf3Data() public méthode

read the type byte, then call the corresponding amf3 data reading function
public readAmf3Data ( ) : mixed
Résultat mixed

readAmf3Date() protected méthode

read amf 3 date
protected readAmf3Date ( ) : boolean | Amfphp_Core_Amf_Types_Date
Résultat boolean | Amfphp_Core_Amf_Types_Date

readAmf3Int() protected méthode

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.
protected readAmf3Int ( ) : read
Résultat read integer value

readAmf3Object() protected méthode

read amf 3 object
protected readAmf3Object ( ) : mixed
Résultat mixed stdClass, or VoClass if VoConverter could find it.

readAmf3String() protected méthode

readString
protected readAmf3String ( ) : string
Résultat string

readAmf3Vector() protected méthode

Reads a vector array of objects from the AMF stream. This works for all vector arrays: vector-object, vector-int vector-uint and vector-double. The Vector is cast to a PHP array. Please note that because of the way php handles integers, uints have to be cast as floats. See {@link http://php.net/manual/en/language.types.integer.php}
protected readAmf3Vector ( $type ) : array
Résultat array The objects in the vector in a native PHP array.

readAmf3VectorValue() protected méthode

Read numeric values from the AMF byte stream. Please be aware that unsigned integers are not really supported in PHP, and for this reason unsigned integers are cast to float. {@link http://php.net/manual/en/language.types.integer.php}.
protected readAmf3VectorValue ( $length, $format ) :
Résultat

readAmf3Xml() protected méthode

read amf 3 xml
protected readAmf3Xml ( ) : Amfphp_Core_Amf_Types_Xml
Résultat Amfphp_Core_Amf_Types_Xml

readAmf3XmlDocument() protected méthode

read amf 3 xml doc
protected readAmf3XmlDocument ( ) : Amfphp_Core_Amf_Types_Xml
Résultat Amfphp_Core_Amf_Types_Xml

readArray() protected méthode

readArray turns an all numeric keyed actionscript array into a php array.
protected readArray ( ) : array
Résultat array The php array

readBuffer() protected méthode

read some data and move pointer
protected readBuffer ( type $len ) : mixed
$len type
Résultat mixed

readByte() protected méthode

readByte grabs the next byte from the data stream and returns it.
protected readByte ( ) : integer
Résultat integer The next byte converted into an integer

readCustomClass() protected méthode

If a VoConverter is available, it is used to instanciate the Vo. If not, 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.
protected readCustomClass ( ) : object
Résultat object The php representation of the object

readData() public méthode

readData is the main switch for mapping a type code to an actual implementation for deciphering it.
public readData ( mixed $type ) : mixed
$type mixed The $type integer
Résultat mixed The php version of the data in the Packet block

readDate() protected méthode

This method is still under development.
protected readDate ( ) : Amfphp_Core_Amf_Types_Date
Résultat Amfphp_Core_Amf_Types_Date a container with the date in ms.

readDouble() protected méthode

readDouble reads the floating point value from the bytes stream and properly orders the bytes depending on the system architecture.
protected readDouble ( ) : float
Résultat float The floating point value of the next 8 bytes

readHeaders() protected méthode

Header information typically contains meta data about the Packet.
protected readHeaders ( )

readInt() protected méthode

readInt grabs the next 2 bytes and returns the next two bytes, shifted and combined to produce the resulting integer
protected readInt ( ) : integer
Résultat integer The resulting integer from the next 2 bytes

readLong() protected méthode

readLong grabs the next 4 bytes shifts and combines them to produce an integer
protected readLong ( ) : integer
Résultat integer The resulting integer from the next 4 bytes

readLongUTF() protected méthode

Then it grabs the next (len) bytes of the resulting in the string
protected readLongUTF ( ) : string
Résultat string The utf8 decoded string

readMessages() protected méthode

read messages in AMF packet
protected readMessages ( )

readMixedArray() protected méthode

readMixedArray turns an array with numeric and string indexes into a php array
protected readMixedArray ( ) : array
Résultat array The php array with mixed indexes

readMixedObject() protected méthode

readMixedObject reads the name/value properties of the amf Packet and converts numeric looking keys to numeric keys
protected readMixedObject ( ) : array
Résultat array The php array with the object data

readObject() protected méthode

readObject reads the name/value properties of the amf Packet and converts them into their equivilent php representation
protected readObject ( ) : Object
Résultat Object The php object filled with the data

readReference() protected méthode

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
protected readReference ( ) : String
Résultat String

readUTF() protected méthode

Then it grabs the next (len) bytes of the resulting string.
protected readUTF ( ) : string
Résultat string The utf8 decoded string

readXml() protected méthode

read xml
protected readXml ( ) : Amfphp_Core_Amf_Types_Xml
Résultat Amfphp_Core_Amf_Types_Xml

resetReferences() protected méthode

reset reference stores
protected resetReferences ( )

resolveType() protected méthode

tries to use the type to get a typed object. If not possible, return a stdClass, with the explicit type marker set if the type was not just an empty string
protected resolveType ( type $typeIdentifier ) : stdClass
$typeIdentifier type
Résultat stdClass or typed object

Property Details

$amf0storedObjects protected_oe property

objects stored for tracking references(amf0)
protected array $amf0storedObjects
Résultat array

$currentByte protected_oe property

The current seek cursor of the stream note: must be initialised here to avoid error 'String offset cast occured'
protected int $currentByte
Résultat integer

$deserializedPacket protected_oe property

the Packet contained in the serialized data
protected $deserializedPacket
Résultat

$headersLeftToProcess protected_oe property

The number of headers in the packet left to process
protected int $headersLeftToProcess
Résultat integer

$messagesLeftToProcess protected_oe property

The number of Messages in the packet left to process
protected int $messagesLeftToProcess
Résultat integer

$rawData protected_oe property

data to deserialize
protected string $rawData
Résultat string

$storedDefinitions protected_oe property

class definitions(traits) stored for tracking references(amf3)
protected array $storedDefinitions
Résultat array

$storedObjects protected_oe property

objects stored for tracking references(amf3)
protected array $storedObjects
Résultat array

$storedStrings protected_oe property

strings stored for tracking references(amf3)
protected array $storedStrings
Résultat array

$voConverter public_oe property

converts VOs directly if set, rather than instanciating anonymous classes that are converted later
public Amfphp_Core_Common_IVoConverter $voConverter
Résultat Amfphp_Core_Common_IVoConverter