class XmlrpcEncoder (View source)

XML-RPC encoder

Main features: - support for and - implements true, XML compliant, HTML numeric entities conversion - support for CDATA values

Methods

__construct()

Constructor method

setEncoding(string $encoding)

Set encoding

string
getEncoding()

Get encoding

setValueType(mixed $value, string $type)

Handle base64 and datetime values

useExNil(bool $mode = true)

Use instead of (apache xmlrpc compliant)

string
encodeResponse(mixed $data)

Encode an xmlrpc response

string
encodeCall(string $method, array $data = array())

Encode an xmlrpc call

string
encodeMulticall(array $data)

Encode an xmlrpc multicall

string
encodeError(int $error_code, string $error_message)

Encode an xmlrpc error

Details

final __construct()

Constructor method

final XmlrpcEncoder setEncoding(string $encoding)

Set encoding

Parameters

string $encoding

Return Value

XmlrpcEncoder

final string getEncoding()

Get encoding

Return Value

string

final XmlrpcEncoder setValueType(mixed $value, string $type)

Handle base64 and datetime values

Parameters

mixed $value The referenced value
string $type The type of value

Return Value

XmlrpcEncoder

final XmlrpcEncoder useExNil(bool $mode = true)

Use instead of (apache xmlrpc compliant)

Parameters

bool $mode

Return Value

XmlrpcEncoder

string encodeResponse(mixed $data)

Encode an xmlrpc response

It expects a scalar, array or NULL as $data and will try to encode it as a valid xmlrpc response.

Parameters

mixed $data

Return Value

string xmlrpc formatted response

Exceptions

XmlrpcException
Exception

string encodeCall(string $method, array $data = array())

Encode an xmlrpc call

It expects an array of values as $data and will try to encode it as a valid xmlrpc call.

Parameters

string $method
array $data

Return Value

string xmlrpc formatted call

Exceptions

XmlrpcException
Exception

string encodeMulticall(array $data)

Encode an xmlrpc multicall

It expects in input a key->val array where key represent the method and val the parameters.

Parameters

array $data

Return Value

string xmlrpc formatted call

Exceptions

XmlrpcException
Exception

string encodeError(int $error_code, string $error_message)

Encode an xmlrpc error

Parameters

int $error_code
string $error_message

Return Value

string xmlrpc formatted error