PHP Класс Amfphp_Core_Amf_Deserializer, amfphp-2.0

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$voConverter Amfphp_Core_Common_IVoConverter converts VOs directly if set, rather than instanciating anonymous classes that are converted later

Защищенные свойства (Protected)

Свойство Тип Описание
$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)

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
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

Описание методов

deserialize() публичный Метод

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
Результат Amfphp_Core_Amf_Packet

readAmf3Array() защищенный Метод

read amf 3 array
protected readAmf3Array ( ) : array
Результат array

readAmf3ByteArray() защищенный Метод

read Amf 3 byte array
protected readAmf3ByteArray ( ) : Amfphp_Core_Amf_Types_ByteArray
Результат Amfphp_Core_Amf_Types_ByteArray

readAmf3Data() публичный Метод

read the type byte, then call the corresponding amf3 data reading function
public readAmf3Data ( ) : mixed
Результат mixed

readAmf3Date() защищенный Метод

read amf 3 date
protected readAmf3Date ( ) : boolean | Amfphp_Core_Amf_Types_Date
Результат boolean | Amfphp_Core_Amf_Types_Date

readAmf3Int() защищенный Метод

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
Результат read integer value

readAmf3Object() защищенный Метод

read amf 3 object
protected readAmf3Object ( ) : mixed
Результат mixed stdClass, or VoClass if VoConverter could find it.

readAmf3String() защищенный Метод

readString
protected readAmf3String ( ) : string
Результат string

readAmf3Vector() защищенный Метод

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
Результат array The objects in the vector in a native PHP array.

readAmf3VectorValue() защищенный Метод

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 ) :
Результат

readAmf3Xml() защищенный Метод

read amf 3 xml
protected readAmf3Xml ( ) : Amfphp_Core_Amf_Types_Xml
Результат Amfphp_Core_Amf_Types_Xml

readAmf3XmlDocument() защищенный Метод

read amf 3 xml doc
protected readAmf3XmlDocument ( ) : Amfphp_Core_Amf_Types_Xml
Результат Amfphp_Core_Amf_Types_Xml

readArray() защищенный Метод

readArray turns an all numeric keyed actionscript array into a php array.
protected readArray ( ) : array
Результат array The php array

readBuffer() защищенный Метод

read some data and move pointer
protected readBuffer ( type $len ) : mixed
$len type
Результат mixed

readByte() защищенный Метод

readByte grabs the next byte from the data stream and returns it.
protected readByte ( ) : integer
Результат integer The next byte converted into an integer

readCustomClass() защищенный Метод

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
Результат object The php representation of the object

readData() публичный Метод

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
Результат mixed The php version of the data in the Packet block

readDate() защищенный Метод

This method is still under development.
protected readDate ( ) : Amfphp_Core_Amf_Types_Date
Результат Amfphp_Core_Amf_Types_Date a container with the date in ms.

readDouble() защищенный Метод

readDouble reads the floating point value from the bytes stream and properly orders the bytes depending on the system architecture.
protected readDouble ( ) : float
Результат float The floating point value of the next 8 bytes

readHeaders() защищенный Метод

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

readInt() защищенный Метод

readInt grabs the next 2 bytes and returns the next two bytes, shifted and combined to produce the resulting integer
protected readInt ( ) : integer
Результат integer The resulting integer from the next 2 bytes

readLong() защищенный Метод

readLong grabs the next 4 bytes shifts and combines them to produce an integer
protected readLong ( ) : integer
Результат integer The resulting integer from the next 4 bytes

readLongUTF() защищенный Метод

Then it grabs the next (len) bytes of the resulting in the string
protected readLongUTF ( ) : string
Результат string The utf8 decoded string

readMessages() защищенный Метод

read messages in AMF packet
protected readMessages ( )

readMixedArray() защищенный Метод

readMixedArray turns an array with numeric and string indexes into a php array
protected readMixedArray ( ) : array
Результат array The php array with mixed indexes

readMixedObject() защищенный Метод

readMixedObject reads the name/value properties of the amf Packet and converts numeric looking keys to numeric keys
protected readMixedObject ( ) : array
Результат array The php array with the object data

readObject() защищенный Метод

readObject reads the name/value properties of the amf Packet and converts them into their equivilent php representation
protected readObject ( ) : Object
Результат Object The php object filled with the data

readReference() защищенный Метод

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
Результат String

readUTF() защищенный Метод

Then it grabs the next (len) bytes of the resulting string.
protected readUTF ( ) : string
Результат string The utf8 decoded string

readXml() защищенный Метод

read xml
protected readXml ( ) : Amfphp_Core_Amf_Types_Xml
Результат Amfphp_Core_Amf_Types_Xml

resetReferences() защищенный Метод

reset reference stores
protected resetReferences ( )

resolveType() защищенный Метод

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
Результат stdClass or typed object

Описание свойств

$amf0storedObjects защищенное свойство

objects stored for tracking references(amf0)
protected array $amf0storedObjects
Результат array

$currentByte защищенное свойство

The current seek cursor of the stream note: must be initialised here to avoid error 'String offset cast occured'
protected int $currentByte
Результат integer

$deserializedPacket защищенное свойство

the Packet contained in the serialized data
protected $deserializedPacket
Результат

$headersLeftToProcess защищенное свойство

The number of headers in the packet left to process
protected int $headersLeftToProcess
Результат integer

$messagesLeftToProcess защищенное свойство

The number of Messages in the packet left to process
protected int $messagesLeftToProcess
Результат integer

$rawData защищенное свойство

data to deserialize
protected string $rawData
Результат string

$storedDefinitions защищенное свойство

class definitions(traits) stored for tracking references(amf3)
protected array $storedDefinitions
Результат array

$storedObjects защищенное свойство

objects stored for tracking references(amf3)
protected array $storedObjects
Результат array

$storedStrings защищенное свойство

strings stored for tracking references(amf3)
protected array $storedStrings
Результат array

$voConverter публичное свойство

converts VOs directly if set, rather than instanciating anonymous classes that are converted later
public Amfphp_Core_Common_IVoConverter $voConverter
Результат Amfphp_Core_Common_IVoConverter