ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
XML_RPC2_FaultException Class Reference
+ Inheritance diagram for XML_RPC2_FaultException:
+ Collaboration diagram for XML_RPC2_FaultException:

Public Member Functions

 __construct ($messageString, $faultCode)
 Construct a new XML_RPC2_FaultException with a given message string and fault code. More...
 
 getFaultCode ()
 FaultCode getter. More...
 
 getFaultString ()
 FaultString getter. More...
 

Static Public Member Functions

static createFromDecode ($xml)
 Create a XML_RPC2_FaultException by decoding the corresponding xml string. More...
 

Protected Attributes

 $faultCode = null
 

Detailed Description

Definition at line 195 of file Exception.php.

Constructor & Destructor Documentation

◆ __construct()

XML_RPC2_FaultException::__construct (   $messageString,
  $faultCode 
)

Construct a new XML_RPC2_FaultException with a given message string and fault code.

Parameters
stringThe message string, corresponding to the faultString present in the response body
stringThe fault code, corresponding to the faultCode in the response body

Definition at line 215 of file Exception.php.

216  {
217  parent::__construct($messageString);
218  $this->faultCode = $faultCode;
219  }

Member Function Documentation

◆ createFromDecode()

static XML_RPC2_FaultException::createFromDecode (   $xml)
static

Create a XML_RPC2_FaultException by decoding the corresponding xml string.

Parameters
string$xml
Returns
object a XML_RPC2_FaultException

Definition at line 258 of file Exception.php.

References XML_RPC2_Backend_Php_Value\createFromDecode().

Referenced by XML_RPC2_Backend_Php_Response\decode().

258  {
259  require_once 'XML/RPC2/Backend/Php/Value.php';
260 
261  // This is the only way I know of creating a new Document rooted in the provided simpleXMLFragment (needed for the xpath expressions that does not segfault sometimes
262  $xml = simplexml_load_string($xml->asXML());
263  $struct = XML_RPC2_Backend_Php_Value::createFromDecode($xml->value)->getNativeValue();
264  if (!(is_array($struct) &&
265  array_key_exists('faultString', $struct) &&
266  array_key_exists('faultCode', $struct))) throw new XML_RPC2_DecodeException('Unable to decode XML-RPC fault payload');
267 
268  return new XML_RPC2_FaultException( $struct['faultString'], $struct['faultCode'] );
269  }
static createFromDecode($simpleXML)
Decode an encoded value and build the applicable XML_RPC2_Value subclass.
Definition: Value.php:215
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFaultCode()

XML_RPC2_FaultException::getFaultCode ( )

FaultCode getter.

Returns
string fault code

Definition at line 229 of file Exception.php.

Referenced by XML_RPC2_Backend_Php_Server\getResponse(), and XML_RPC2_Backend_Xmlrpcext_Server\getResponse().

230  {
231  return $this->faultCode;
232  }
+ Here is the caller graph for this function:

◆ getFaultString()

XML_RPC2_FaultException::getFaultString ( )

FaultString getter.

This is an alias to getMessage() in order to respect XML-RPC nomenclature for faults

Returns
string fault code

Definition at line 244 of file Exception.php.

245  {
246  return $this->getMessage();
247  }

Field Documentation

◆ $faultCode

XML_RPC2_FaultException::$faultCode = null
protected

Definition at line 205 of file Exception.php.


The documentation for this class was generated from the following file: