This class exports some internal (public) methods.

This way, those methods can be tested separately.

package Tests_Amfphp_Core_Amf
author Ariel Sommeria-klein

 Methods

constructor

__construct(string $raw) 

Parameters

$raw

string

convert from text/binary to php object

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

Parameters

$getData

array

$postData

array

$rawPostData

string

Returns

read amf 3 array

readAmf3Array() : array

Returns

array

read byte array

readAmf3ByteArray() : \Amfphp_Core_Amf_Types_ByteArray

read amf3 data

readAmf3Data() : mixed

Returns

mixed

read amf 3 object

readAmf3Object() : \stdClass

Returns

read amf3 string

readAmf3String() : string

Returns

string

read array

readArray() : array

Returns

array

read byte

readByte() : int

Returns

int

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

readData(mixed $type) : mixed
Inherited
inherited_from \Amfphp_Core_Amf_Deserializer::readData()

Parameters

$type

mixed

The $type integer

Returns

mixedThe php version of the data in the Packet block

read date

readDate() : \Amfphp_Core_Amf_Types_Date

This method is still under development.

Returns

\Amfphp_Core_Amf_Types_Datea container with the date in ms.

reaad double

readDouble() : float

Returns

float

read int

readInt() : int

Returns

int

read long

readLong() : int

Returns

int

read long utf

readLongUtf() : string

Returns

string

read mixed array

readMixedArray() : array

Returns

array

read object

readObject() : \stdClass

Returns

read reference

readReference() : \stdClass

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

read utf

readUtf() : string

Returns

string

read amf 3 date

readAmf3Date() : boolean | \Amfphp_Core_Amf_Types_Date
Inherited
inherited_from \Amfphp_Core_Amf_Deserializer::readAmf3Date()

Exceptions

\Amfphp_Core_Exception

Returns

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.

readAmf3Int() : \read
Inherited
inherited_from \Amfphp_Core_Amf_Deserializer::readAmf3Int()

Returns

\readinteger value

read amf 3 xml

readAmf3Xml() : \Amfphp_Core_Amf_Types_Xml
Inherited
inherited_from \Amfphp_Core_Amf_Deserializer::readAmf3Xml()

Returns

read amf 3 xml doc

readAmf3XmlDocument() : \Amfphp_Core_Amf_Types_Xml
Inherited
inherited_from \Amfphp_Core_Amf_Deserializer::readAmf3XmlDocument()

Returns

read some data and move pointer

readBuffer(\type $len) : mixed
Inherited
inherited_from \Amfphp_Core_Amf_Deserializer::readBuffer()

Parameters

$len

\type

Returns

mixed

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

readCustomClass() : object
Inherited

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.

inherited_from \Amfphp_Core_Amf_Deserializer::readCustomClass()

Returns

objectThe php representation of the object

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

readHeaders() 
Inherited

Header information typically contains meta data about the Packet.

inherited_from \Amfphp_Core_Amf_Deserializer::readHeaders()

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

readLongUTF() : string
Inherited

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

inherited_from \Amfphp_Core_Amf_Deserializer::readLongUTF()

Returns

stringThe utf8 decoded string

read messages in AMF packet

readMessages() 
Inherited
inherited_from \Amfphp_Core_Amf_Deserializer::readMessages()

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

readMixedObject() : array
Inherited
inherited_from \Amfphp_Core_Amf_Deserializer::readMixedObject()

Returns

arrayThe php array with the object data

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

readUTF() : string
Inherited

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

inherited_from \Amfphp_Core_Amf_Deserializer::readUTF()

Returns

stringThe utf8 decoded string

read xml

readXml() : \Amfphp_Core_Amf_Types_Xml
Inherited
inherited_from \Amfphp_Core_Amf_Deserializer::readXml()

Returns

reset reference stores

resetReferences() 
Inherited
inherited_from \Amfphp_Core_Amf_Deserializer::resetReferences()

 Properties

 

$amf0storedObjects : array
Inherited
inherited_from \Amfphp_Core_Amf_Deserializer::$$amf0storedObjects
 

$currentByte : int
Inherited
access protected
inherited_from \Amfphp_Core_Amf_Deserializer::$$currentByte
 

$deserializedPacket : \<Amfphp_Core_Amf_Packet>
Inherited
inherited_from \Amfphp_Core_Amf_Deserializer::$$deserializedPacket
 

$headersLeftToProcess : int
Inherited
access protected
inherited_from \Amfphp_Core_Amf_Deserializer::$$headersLeftToProcess
 

$messagesLeftToProcess : int
Inherited
access protected
inherited_from \Amfphp_Core_Amf_Deserializer::$$messagesLeftToProcess
 

$rawData : string
Inherited
inherited_from \Amfphp_Core_Amf_Deserializer::$$rawData
 

$storedDefinitions : array
Inherited
inherited_from \Amfphp_Core_Amf_Deserializer::$$storedDefinitions
 

$storedObjects : array
Inherited
inherited_from \Amfphp_Core_Amf_Deserializer::$$storedObjects
 

$storedStrings : array
Inherited
inherited_from \Amfphp_Core_Amf_Deserializer::$$storedStrings