An XML-RPC encoder that transparently converts PHP types to their XML-RPC counterpart.
More...
|
static | isBinaryString ($text) |
|
static | isUTF8 ($text) |
|
An XML-RPC encoder that transparently converts PHP types to their XML-RPC counterpart.
- Authors
- François Poirotte click.nosp@m.y@er.nosp@m.ebot..nosp@m.net
Definition at line 21 of file NativeEncoder.php.
static fpoirotte\XRL\NativeEncoder::convert |
( |
|
$value | ) |
|
|
static |
Convert the given PHP value to an XML-RPC type.
- Parameters
-
mixed | $value | The PHP value to convert. |
- Return values
-
- Note
- This implementation supports the "nil" XML-RPC extension (http://ontosys.com/xml-rpc/extensions.php).
-
An empty PHP array will always be encoded as an empty XML-RPC array.
-
The following PHP types are currently supported:
null
(encoded using the "nil" XML-RPC type).
- integer (encoded using the "i4" or "i8" XML-RPC type, depending on the actual size required to store the value).
- boolean (encoded using the "boolean" XML-RPC type).
- string (encoded using either the default type of XML-RPC [string] or "base64" if the string contains invalid UTF-8 sequences, such as when encoding binary data).
- double (encoded using the "double" XML-RPC type).
- array (encoded using either the "array" or "struct" XML-RPC type):
- "array" is used for numerically-indexed arrays where the keys are in the range [0..len(array)-1], aka "lists".
- "struct" is used for all other arrays, aka "hashes".
- DateTime objects (encoded using the "dateTime.iso8601" XML-RPC type).
- GMP objects/resources (encoded as "i4", "i8" or "BigInteger", depending on their actual storage size).
- XML objects (SimpleXML, DOM and XMLWriter objects) are encoded as XML DOM fragments.
- objects that support serialization (encoded as an XML-RPC "string" or "base64" type depending on the object's representation in serialized form).
Definition at line 258 of file NativeEncoder.php.
Referenced by fpoirotte\XRL\Encoder\encodeError().
fpoirotte\XRL\NativeEncoder::encodeError |
( |
\Exception |
$error | ) |
|
fpoirotte\XRL\NativeEncoder::encodeResponse |
( |
|
$response | ) |
|
static fpoirotte\XRL\NativeEncoder::isUTF8 |
( |
|
$text | ) |
|
|
staticprotected |
Determine if a string contains a valid sequence of UTF-8 encoded Unicode codepoints.
- Parameters
-
string | $text | Some text to test for UTF-8 validity. |
- Return values
-
bool | true if the $text contains a valid UTF-8 sequence which does not make use of non-characters/reserved characters, null if it contains a valid UTF-8 containing non-characters/reserved characters, or false otherwise. |
Definition at line 50 of file NativeEncoder.php.
The documentation for this class was generated from the following file: