|
XRL
latest
Simple XML-RPC Library (both client and server)
|
An XML-RPC encoder that can produce either compact documents or pretty documents. More...
Inheritance diagram for fpoirotte\XRL\Encoder:Public Member Functions | |
| __construct (\DateTimeZone $timezone=null, $indent=false, $stringTag=false) | |
| encodeError (\Exception $error) | |
| encodeRequest (\fpoirotte\XRL\Request $request) | |
| encodeResponse ($response) | |
Protected Member Functions | |
| finalizeWrite (\XMLWriter $writer) | |
| getWriter () | |
Protected Attributes | |
| $indent | |
Whether the output should be indented (true) or not (false). | |
| $stringTag | |
Whether the "\<string\>" tag should be used (true) or not (false). | |
| $timezone | |
| Timezone used to encode date/times. | |
An XML-RPC encoder that can produce either compact documents or pretty documents.
Definition at line 21 of file Encoder.php.
| fpoirotte\XRL\Encoder::__construct | ( | \DateTimeZone | $timezone = null, |
$indent = false, |
|||
$stringTag = false |
|||
| ) |
Create a new XML-RPC encoder.
| DateTimeZone | $timezone | (optional) Information on the timezone for which date/times should be encoded. If omitted, the machine's current timezone is used. |
| bool | $indent | (optional) Whether the XML produced should be indented (true) or not (false). Defaults to no indentation. |
| bool | $stringTag | (optional) Whether strings should be encoded explicitly using the <string> tag (true) or implicitly (false). Defaults to not using such tags. |
| InvalidArgumentException | An invalid value was passed for either the $indent or $stringTag argument. |
Definition at line 54 of file Encoder.php.
References fpoirotte\XRL\Encoder\$indent, fpoirotte\XRL\Encoder\$stringTag, and fpoirotte\XRL\Encoder\$timezone.
| fpoirotte\XRL\Encoder::encodeError | ( | \Exception | $error | ) |
Encode an exception as an XML-RPC failure.
| Exception | $error | The exception to encode. |
| string | The exception, encoded as a XML-RPC failure in serialized form. |
Implements fpoirotte\XRL\EncoderInterface.
Definition at line 151 of file Encoder.php.
References fpoirotte\XRL\NativeEncoder\convert(), fpoirotte\XRL\Encoder\finalizeWrite(), and fpoirotte\XRL\Encoder\getWriter().
| fpoirotte\XRL\Encoder::encodeRequest | ( | \fpoirotte\XRL\Request | $request | ) |
Encode an XML-RPC request.
| fpoirotte::XRL::Request | $request | The XML-RPC request to encode. |
| string | The XML-RPC request, encoded as serialized XML. |
Implements fpoirotte\XRL\EncoderInterface.
Definition at line 129 of file Encoder.php.
References fpoirotte\XRL\Encoder\finalizeWrite(), and fpoirotte\XRL\Encoder\getWriter().
| fpoirotte\XRL\Encoder::encodeResponse | ( | $response | ) |
Encode an XML-RPC response.
| mixed | $response | The XML-RPC response to encode. |
| string | The XML-RPC reponse, encoded as serialized XML. |
Implements fpoirotte\XRL\EncoderInterface.
Definition at line 167 of file Encoder.php.
References fpoirotte\XRL\Encoder\finalizeWrite(), and fpoirotte\XRL\Encoder\getWriter().
|
protected |
This method must be called when the document is complete and returns the document.
| XMLWriter | $writer | XML writer used to produce the document. |
| string | The XML document that was generated, as serialized XML. |
Definition at line 107 of file Encoder.php.
Referenced by fpoirotte\XRL\Encoder\encodeError(), fpoirotte\XRL\Encoder\encodeRequest(), and fpoirotte\XRL\Encoder\encodeResponse().
|
protected |
Return an XML writer that will be used to produce XML-RPC requests and responses.
| XMLWriter | XML writer to use to produce documents. |
Definition at line 82 of file Encoder.php.
Referenced by fpoirotte\XRL\Encoder\encodeError(), fpoirotte\XRL\Encoder\encodeRequest(), and fpoirotte\XRL\Encoder\encodeResponse().