You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

54 lines
854 B

  1. <?php
  2. /**
  3. * IXR_Error
  4. *
  5. * @package IXR
  6. * @since 1.5.0
  7. */
  8. class IXR_Error
  9. {
  10. var $code;
  11. var $message;
  12. /**
  13. * PHP5 constructor.
  14. */
  15. function __construct( $code, $message )
  16. {
  17. $this->code = $code;
  18. $this->message = htmlspecialchars($message);
  19. }
  20. /**
  21. * PHP4 constructor.
  22. */
  23. public function IXR_Error( $code, $message ) {
  24. self::__construct( $code, $message );
  25. }
  26. function getXml()
  27. {
  28. $xml = <<<EOD
  29. <methodResponse>
  30. <fault>
  31. <value>
  32. <struct>
  33. <member>
  34. <name>faultCode</name>
  35. <value><int>{$this->code}</int></value>
  36. </member>
  37. <member>
  38. <name>faultString</name>
  39. <value><string>{$this->message}</string></value>
  40. </member>
  41. </struct>
  42. </value>
  43. </fault>
  44. </methodResponse>
  45. EOD;
  46. return $xml;
  47. }
  48. }