Properties

$voConverter

$voConverter : \Amfphp_Core_Common_IVoConverter

converts VOs directly if set, rather than instanciating anonymous classes that are converted later

Type

\Amfphp_Core_Common_IVoConverter

$rawData

$rawData : string

data to deserialize

Type

string

$messagesLeftToProcess

$messagesLeftToProcess : integer

The number of Messages in the packet left to process

Type

integer

$currentByte

$currentByte : integer

The current seek cursor of the stream

Type

integer

$headersLeftToProcess

$headersLeftToProcess : integer

The number of headers in the packet left to process

Type

integer

$deserializedPacket

$deserializedPacket : \<Amfphp_Core_Amf_Packet>

the Packet contained in the serialized data

Type

\

$storedStrings

$storedStrings : array

strings stored for tracking references(amf3)

Type

array

$storedObjects

$storedObjects : array

objects stored for tracking references(amf3)

Type

array

$storedDefinitions

$storedDefinitions : array

class definitions(traits) stored for tracking references(amf3)

Type

array

$amf0storedObjects

$amf0storedObjects : array

objects stored for tracking references(amf0)

Type

array

Methods

deserialize()

deserialize(array $getData, array $postData, string $rawPostData) : \Amfphp_Core_Amf_Packet

convert from text/binary to php object

Parameters

array $getData
array $postData
string $rawPostData

Returns

\Amfphp_Core_Amf_Packet

readData()

readData(mixed $type) : mixed

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

Parameters

mixed $type

The $type integer

Returns

mixed —

The php version of the data in the Packet block

readAmf3Data()

readAmf3Data() : mixed

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

Returns

mixed

resetReferences()

resetReferences()

reset reference stores

readHeaders()

readHeaders()

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

Header information typically contains meta data about the Packet.

readMessages()

readMessages()

read messages in AMF packet

readInt()

readInt() : integer

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

Returns

integer —

The resulting integer from the next 2 bytes

readUTF()

readUTF() : string

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

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

Returns

string —

The utf8 decoded string

readByte()

readByte() : integer

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

Returns

integer —

The next byte converted into an integer

readDouble()

readDouble() : float

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

Returns

float —

The floating point value of the next 8 bytes

readObject()

readObject() : Object

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

Returns

Object —

The php object filled with the data

readReference()

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

Returns

String

readMixedArray()

readMixedArray() : array

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

Returns

array —

The php array with mixed indexes

readMixedObject()

readMixedObject() : array

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

Returns

array —

The php array with the object data

readArray()

readArray() : array

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

Returns

array —

The php array

readDate()

readDate() : \Amfphp_Core_Amf_Types_Date

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

This method is still under development.

Returns

\Amfphp_Core_Amf_Types_Date

a container with the date in ms.

readLongUTF()

readLongUTF() : string

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

Returns

string —

The utf8 decoded string

resolveType()

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

Parameters

\type $typeIdentifier

Returns

\stdClass —

or typed object

readCustomClass()

readCustomClass() : object

readCustomClass reads the amf content associated with a class instance which was registered with Object.registerClass.

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.

Returns

object —

The php representation of the object

readAmf3Int()

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.

Returns

\read —

integer value

readAmf3Date()

readAmf3Date() : boolean|\Amfphp_Core_Amf_Types_Date

read amf 3 date

Throws

\Amfphp_Core_Exception

Returns

boolean|\Amfphp_Core_Amf_Types_Date

readAmf3String()

readAmf3String() : string

readString

Returns

string

readAmf3Array()

readAmf3Array() : array

read amf 3 array

Returns

array

readAmf3Object()

readAmf3Object() : mixed

read amf 3 object

Returns

mixed —

stdClass, or VoClass if VoConverter could find it.

readLong()

readLong() : integer

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

Returns

integer —

The resulting integer from the next 4 bytes

readBuffer()

readBuffer(\type $len) : mixed

read some data and move pointer

Parameters

\type $len

Returns

mixed

readAmf3Vector()

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}

Parameters

$type

Returns

array —

The objects in the vector in a native PHP array.

readAmf3VectorValue()

readAmf3VectorValue( $length,  $format) : \<type>

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}.

Parameters

$length
$format

Returns

\