ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
XML_RPC2_Backend_Php_Client Class Reference
+ Inheritance diagram for XML_RPC2_Backend_Php_Client:
+ Collaboration diagram for XML_RPC2_Backend_Php_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 64 of file Client.php.

Constructor & Destructor Documentation

◆ __construct()

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

Construct a new XML_RPC2_Client PHP Backend.

To create a new XML_RPC2_Client, 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 78 of file Client.php.

References $options, and XML_RPC2_Client\$uri.

79  {
80  parent::__construct($uri, $options);
81  }
if(!is_array($argv)) $options

Member Function Documentation

◆ remoteCall___()

XML_RPC2_Backend_Php_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 95 of file Client.php.

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

96  {
97  $request = new XML_RPC2_Backend_Php_Request($this->prefix . $methodName, $this->encoding);
98  $request->setParameters($parameters);
99  $request = $request->encode();
100  $uri = $this->uri;
101  $options = array(
102  'encoding' => $this->encoding,
103  'proxy' => $this->proxy,
104  'sslverify' => $this->sslverify
105  );
106  $httpRequest = new XML_RPC2_Util_HTTPRequest($uri, $options);
107  $httpRequest->setPostData($request);
108  $httpRequest->sendRequest();
109  $body = $httpRequest->getBody();
110  if ($this->debug) {
111  $this->displayDebugInformations___($request, $body);
112  }
113  try {
114  $result = XML_RPC2_Backend_Php_Response::decode(simplexml_load_string($body));
115  } catch (XML_RPC2_Exception $e) {
116  if ($this->debug) {
117  if (get_class($e)=='XML_RPC2_FaultException') {
118  print "XML_RPC2_FaultException #" . $e->getFaultCode() . " : " . $e->getMessage();
119  } else {
120  print get_class($e) . " : " . $e->getMessage();
121  }
122  }
123  throw $e;
124  }
125  if ($this->debug) {
127  }
128  return $result;
129  }
$result
static decode(SimpleXMLElement $xml)
Parse a response and either return the native PHP result.
Definition: Response.php:125
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: