Class AmfphpCharsetConverter

Description

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.

  • author: Ariel Sommeria-Klein

Located in /Amfphp/Plugins/AmfphpCharsetConverter/AmfphpCharsetConverter.php (line 20)


	
			
Class Constant Summary
Variable Summary
String $method
String $phpCharset
Method Summary
AmfphpCharsetConverter __construct ([ $config = null])
mixed filterDeserializedRequest (mixed $deserializedRequest)
mixed filterDeserializedResponse (mixed $deserializedResponse)
String transliterate (String $string, int $direction)
Variables
String $clientCharset (line 79)

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/

  • access: public
String $method (line 50)

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

  • access: public
String $phpCharset (line 69)

the Charset that is used in php default utf-8.

See all the possible codepages for iconv here: http://www.gnu.org/software/libiconv/

  • access: public
Methods
Constructor __construct (line 85)

constructor.

  • access: public
AmfphpCharsetConverter __construct ([ $config = null])
  • array $config: optional key/value pairs in an associative array. Used to override default configuration values.
convertStringFromClientToPhpCharsets (line 184)

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

  • access: public
mixed convertStringFromClientToPhpCharsets (mixed $obj)
  • mixed $obj
convertStringFromPhpToClientCharsets (line 200)

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

  • access: public
mixed convertStringFromPhpToClientCharsets (mixed $obj)
  • mixed $obj
filterDeserializedRequest (line 120)

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

  • access: public
mixed filterDeserializedRequest (mixed $deserializedRequest)
  • mixed $deserializedRequest
filterDeserializedResponse (line 131)

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

  • access: public
mixed filterDeserializedResponse (mixed $deserializedResponse)
  • mixed $deserializedResponse
transliterate (line 144)

convert the string. finds the proper encoding depending on direction

  • access: protected
String transliterate (String $string, int $direction)
  • String $string: data to convert
  • int $direction: one of the DIRECTION_XXX consts described above
Class Constants
DIRECTION_CLIENT_TO_PHP = 1 (line 60)

transliterate direction

DIRECTION_PHP_TO_CLIENT = 0 (line 55)

transliterate direction

METHOD_ICONV = 'iconv' (line 29)

uses the iconv library for reencoding

METHOD_MBSTRING = 'mbstring' (line 34)

uses the mbstring library for reencoding

METHOD_NONE = 'none' (line 24)

don't do anything

METHOD_RECODE = 'recode' (line 39)

uses the recode library for reencoding

METHOD_UTF8_DECODE = 'utf8_decode' (line 44)

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

Documentation generated on Mon, 23 Jan 2012 17:22:01 -0300 by phpDocumentor 1.4.3