projects
/
m6w6
/
ext-http
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
v1.7 maintenance branch
[m6w6/ext-http]
/
lib
/
XmlRpcClient.php
diff --git
a/lib/XmlRpcClient.php
b/lib/XmlRpcClient.php
index c7abb2a04592aac4979ab118e0305522dc4492d1..8668291bd0a31cb7566f5dad25bd2c026b4ff6c3 100644
(file)
--- a/
lib/XmlRpcClient.php
+++ b/
lib/XmlRpcClient.php
@@
-47,6
+47,13
@@
class XmlRpcClient
*/
public $__encoding = "iso-8859-1";
*/
public $__encoding = "iso-8859-1";
+ /**
+ * RPC options
+ *
+ * @var array
+ */
+ public $__options;
+
/**
* Constructor
*
/**
* Constructor
*
@@
-56,7
+63,7
@@
class XmlRpcClient
*/
public function __construct($url, $namespace = '', array $options = null)
{
*/
public function __construct($url, $namespace = '', array $options = null)
{
- $this->__request = new HttpRequest($url, HttpRequest::METH_POST, $options);
+ $this->__request = new HttpRequest($url, HttpRequest::METH_POST,
(array)
$options);
$this->__namespace = $namespace;
}
$this->__namespace = $namespace;
}
@@
-70,15
+77,14
@@
class XmlRpcClient
*/
public function __call($method, array $params)
{
*/
public function __call($method, array $params)
{
- if (
$this->__namespace
) {
+ if (
strlen($this->__namespace)
) {
$method = $this->__namespace .'.'. $method;
}
$method = $this->__namespace .'.'. $method;
}
- $this->__request->setContentType("text/xml
; charset=". $this->__encoding
);
+ $this->__request->setContentType("text/xml
"
);
$this->__request->setRawPostData(
xmlrpc_encode_request($method, $params,
$this->__request->setRawPostData(
xmlrpc_encode_request($method, $params,
- array("encoding" => $this->__encoding)));
- $this->__request->send();
- $response = $this->__request->getResponseMessage();
+ array("encoding" => $this->__encoding) + (array) $this->__options));
+ $response = $this->__request->send();
if ($response->getResponseCode() != 200) {
throw new Exception(
$response->getResponseStatus(),
if ($response->getResponseCode() != 200) {
throw new Exception(
$response->getResponseStatus(),