X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=lib%2FXmlRpcClient.php;h=8668291bd0a31cb7566f5dad25bd2c026b4ff6c3;hp=488e1cf0c59e91f25f6406acedb56c0b9bc0bc58;hb=ad5f896b03adaa073134a00108a9cdf00720673a;hpb=f39ea2b145caa37d9614a8a437ffd3d8914b52f0 diff --git a/lib/XmlRpcClient.php b/lib/XmlRpcClient.php index 488e1cf..8668291 100644 --- a/lib/XmlRpcClient.php +++ b/lib/XmlRpcClient.php @@ -47,6 +47,13 @@ class XmlRpcClient */ public $__encoding = "iso-8859-1"; + /** + * RPC options + * + * @var array + */ + public $__options; + /** * Constructor * @@ -54,9 +61,9 @@ class XmlRpcClient * @param string $namespace RPC namespace * @param array $options HttpRequest options */ - public function __construct($url, $namespace = '', array $options = array()) + 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; } @@ -76,7 +83,7 @@ class XmlRpcClient $this->__request->setContentType("text/xml"); $this->__request->setRawPostData( xmlrpc_encode_request($method, $params, - array("encoding" => $this->__encoding))); + array("encoding" => $this->__encoding) + (array) $this->__options)); $response = $this->__request->send(); if ($response->getResponseCode() != 200) { throw new Exception(