blob: 4dfcfafeaceb8a9d0f387efa04b1ab4bda17a6ae (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
<?php
/**
* @class XMLRPCErrorResponse
* @author Curverider Ltd
*/
class XMLRPCErrorResponse extends XMLRPCResponse
{
/**
* Set the error response and error code.
*
* @param string $message The message
* @param int $code Error code (default = system error as defined by http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php)
*/
function __construct($message, $code = -32400)
{
$this->addParameter(
new XMLRPCStructParameter(
array (
'faultCode' => new XMLRPCIntParameter($code),
'faultString' => new XMLRPCStringParameter($message)
)
)
);
}
/**
* Output to XML.
*/
public function __toString()
{
return "<methodResponse><fault><value>{$this->parameters[0]}</value></fault></methodResponse>";
}
}
|