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

Public Member Functions

 __construct ($uri, $options=array())
 Construct a new XML_RPC2_Client PHP Backend. More...
 
 remoteCall___ ($methodName, $parameters)
 remoteCall executes the XML-RPC call, and returns the result More...
 
- Public Member Functions inherited from XML_RPC2_Client
 remoteCall___ ($methodName, $parameters)
 remoteCall executes the XML-RPC call, and returns the result More...
 
 __call ($methodName, $parameters)
 __call Catchall. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from XML_RPC2_Client
static create ($uri, $options=array())
 Factory method to select, create and return a XML_RPC2_Client backend. More...
 
- Data Fields inherited from XML_RPC2_Client
const VERSION = '1.0.4'
 
- Protected Member Functions inherited from XML_RPC2_Client
 __construct ($uri, $options=array())
 Construct a new XML_RPC2_Client. More...
 
 displayDebugInformations___ ($request, $body)
 Display debug informations. More...
 
 displayDebugInformations2___ ($result)
 Display debug informations (part 2) More...
 
 testMethodName___ ($methodName)
 Return true is the given method name is ok with XML/RPC spec. More...
 
- Protected Attributes inherited from XML_RPC2_Client
 $uri = null
 
 $proxy = null
 
 $prefix = null
 
 $debug = false
 
 $encoding = 'iso-8859-1'
 
 $sslverify = true
 
 $uglyStructHack = true
 ugly hack flag to avoid http://bugs.php.net/bug.php?id=21949 More...
 

Detailed Description

Definition at line 58 of file Client.php.

Constructor & Destructor Documentation

◆ __construct()

XML_RPC2_Backend_Xmlrpcext_Client::__construct (   $uri,
  $options = array() 
)

Construct a new XML_RPC2_Client PHP Backend.

A URI must be provided (e.g. http://xmlrpc.example.com/1.0/). Optionally, some options may be set.

Parameters
stringURI for the XML-RPC server
array(optional) Associative array of options

Definition at line 72 of file Client.php.

References $options, and XML_RPC2_Client\$uri.

73  {
74  parent::__construct($uri, $options);
75  }
if(!is_array($argv)) $options

Member Function Documentation

◆ remoteCall___()

XML_RPC2_Backend_Xmlrpcext_Client::remoteCall___ (   $methodName,
  $parameters 
)

remoteCall executes the XML-RPC call, and returns the result

NB : The '___' at the end of the method name is to avoid collisions with XMLRPC __call()

Parameters
stringMethod name
arrayParameters

Definition at line 89 of file Client.php.

References $options, $result, XML_RPC2_Client\$uri, XML_RPC2_Client\displayDebugInformations2___(), and XML_RPC2_Client\displayDebugInformations___().

90  {
91  $tmp = xmlrpc_encode_request($this->prefix . $methodName, $parameters, array('encoding' => $this->encoding));
92  if ($this->uglyStructHack) {
93  // ugly hack because of http://bugs.php.net/bug.php?id=21949
94  // see XML_RPC2_Backend_Xmlrpcext_Value::createFromNative() from more infos
95  $request = preg_replace('~<name>xml_rpc2_ugly_struct_hack_(.*)</name>~', '<name>\1</name>', $tmp);
96  } else {
97  $request = $tmp;
98  }
99  $uri = $this->uri;
100  $options = array(
101  'encoding' => $this->encoding,
102  'proxy' => $this->proxy,
103  'sslverify' => $this->sslverify
104  );
105  $httpRequest = new XML_RPC2_Util_HTTPRequest($uri, $options);
106  $httpRequest->setPostData($request);
107  $httpRequest->sendRequest();
108  $body = $httpRequest->getBody();
109  if ($this->debug) {
110  $this->displayDebugInformations___($request, $body);
111  }
112  $result = xmlrpc_decode($body, $this->encoding);
113  /* Commented due to change in behaviour from xmlrpc_decode. It does not return faults now
114  if ($result === false || is_null($result)) {
115  if ($this->debug) {
116  print "XML_RPC2_Exception : unable to decode response !";
117  }
118  throw new XML_RPC2_Exception('Unable to decode response');
119  }
120  */
121  if (xmlrpc_is_fault($result)) {
122  if ($this->debug) {
123  print "XML_RPC2_FaultException(${result['faultString']}, ${result['faultCode']})";
124  }
125  throw new XML_RPC2_FaultException($result['faultString'], $result['faultCode']);
126  }
127  if ($this->debug) {
129  }
130  return $result;
131  }
$result
displayDebugInformations___($request, $body)
Display debug informations.
Definition: Client.php:248
displayDebugInformations2___($result)
Display debug informations (part 2)
Definition: Client.php:270
if(!is_array($argv)) $options
+ Here is the call graph for this function:

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