\AmfphpCharsetConverter

Converts strings to the right encoding in incoming and outgoing packets.

This plugin can be deactivated if all three tiers (DB, PHP, client) use the same charset, usually utf8. This works for nested objects.

Summary

Methods
Properties
Constants
__construct()
filterDeserializedRequest()
filterDeserializedResponse()
convertStringFromClientToPhpCharsets()
convertStringFromPhpToClientCharsets()
$method
$phpCharset
$clientCharset
METHOD_NONE
METHOD_ICONV
METHOD_MBSTRING
METHOD_RECODE
METHOD_UTF8_DECODE
DIRECTION_PHP_TO_CLIENT
DIRECTION_CLIENT_TO_PHP
transliterate()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Constants

METHOD_NONE

METHOD_NONE

don't do anything

METHOD_ICONV

METHOD_ICONV

uses the iconv library for reencoding

METHOD_MBSTRING

METHOD_MBSTRING

uses the mbstring library for reencoding

METHOD_RECODE

METHOD_RECODE

uses the recode library for reencoding

METHOD_UTF8_DECODE

METHOD_UTF8_DECODE

uses the XML function utf8_decode and encode for reencoding - ISO-8859-1 only

DIRECTION_PHP_TO_CLIENT

DIRECTION_PHP_TO_CLIENT

transliterate direction

DIRECTION_CLIENT_TO_PHP

DIRECTION_CLIENT_TO_PHP

transliterate direction

Properties

$method

$method : String

the reencoding method. One of the METHOD_XXX consts defined above.

Type

String

$clientCharset

$clientCharset : String

the Charset that is used by the client. default utf-8 See all the possible codepages for iconv here: http://www.gnu.org/software/libiconv/

Type

String

Methods

__construct()

__construct(array $config)

constructor.

Parameters

array $config

optional key/value pairs in an associative array. Used to override default configuration values.

filterDeserializedRequest()

filterDeserializedRequest(mixed $deserializedRequest) : mixed

converts untyped objects to their typed counterparts. Loads the class if necessary

Parameters

mixed $deserializedRequest

Returns

mixed

filterDeserializedResponse()

filterDeserializedResponse(mixed $deserializedResponse) : mixed

looks at the response and sets the explicit type field so that the serializer sends it properly

Parameters

mixed $deserializedResponse

Returns

mixed

convertStringFromClientToPhpCharsets()

convertStringFromClientToPhpCharsets(mixed $obj) : mixed

converts the strings note: This is not a recursive function. Rather the recursion is handled by Amfphp_Core_Amf_Util::applyFunctionToContainedObjects.

must be public so that Amfphp_Core_Amf_Util::applyFunctionToContainedObjects can call it

Parameters

mixed $obj

Returns

mixed

convertStringFromPhpToClientCharsets()

convertStringFromPhpToClientCharsets(mixed $obj) : mixed

note: This is not a recursive function. Rather the recusrion is handled by Amfphp_Core_Amf_Util::applyFunctionToContainedObjects.

must be public so that Amfphp_Core_Amf_Util::applyFunctionToContainedObjects can call it

Parameters

mixed $obj

Returns

mixed

transliterate()

transliterate(String $string, integer $direction) : String

convert the string. finds the proper encoding depending on direction

Parameters

String $string

data to convert

integer $direction

one of the DIRECTION_XXX consts described above

Returns

String