From: gggeek Date: Mon, 2 Jan 2023 16:25:51 +0000 (+0000) Subject: improve the proxy demo X-Git-Tag: 4.9.4~42 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=e7d0817bd555711c6522d954d19b1c7e4db689ca;p=plcapi.git improve the proxy demo --- diff --git a/demo/client/proxy.php b/demo/client/proxy.php index 12b0a158..800ee86f 100644 --- a/demo/client/proxy.php +++ b/demo/client/proxy.php @@ -14,11 +14,13 @@ class PhpXmlRpcProxy { protected $client; protected $prefix; + protected $encodingOptions = array(); - public function __construct(PhpXmlRpc\Client $client, $prefix = 'examples.') + public function __construct(PhpXmlRpc\Client $client, $prefix = 'examples.', $encodingOptions = array()) { $this->client = $client; $this->prefix = $prefix; + $this->encodingOptions = $encodingOptions; } /** @@ -38,7 +40,7 @@ class PhpXmlRpcProxy $encoder = new PhpXmlRpc\Encoder(); $valueArray = array(); foreach ($arguments as $parameter) { - $valueArray[] = $encoder->encode($parameter); + $valueArray[] = $encoder->encode($parameter, $this->encodingOptions); } // just in case this was set to something else