Re: [PEPr] -1 for XML::XML_RPC2

From: Date: Thu, 12 May 2005 22:14:56 +0000
Subject: Re: [PEPr] -1 for XML::XML_RPC2
References: 1 2 3 4 5 6 7 8  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-37611@lists.php.net to get a copy of this message
Greg Beaver wrote:
Sergio Carvalho wrote:
I may need to refer to the actual type. Namely, when automatic mapping can't work: - PHP Arrays to either XML-RPC struct or XML-RPC array.
I find this decision rather simple: if there are any non-sequential or non-numeric indices, struct is used, otherwise array is used.
As Sergio pointed out, this may fail in certain situations where a numeric sequential array should still be set as struct.
- PHP Strings to either XML-RPC string or XML-RPC base64 string.
This must be developer-based. I don't think you understand what I was saying with my comments on OO - you thought I was talking about XML_RPC2 when I was explaining what makes something OO, but I was talking about Chiara_XML_RPC5. Email is not always the clearest medium. The way I have people do this in Chiara_XML_RPC5 is: <?php $xmlrpc = new Chiara_XML_RPC5('http://example.com/xmlrpc.php'); $arr = array(1,2,'base64'); $xmlrpc->setType($arr[2], 'base64'); $result = $xmlrpc->someFunction($arr); ?>
- PHP ints to either XML-RPC int or XML-RPC dateTime.
Same as above example but use 'datetime' For the server end, the server has to create the values and use setType in the same manner.
This is not an ideal way to do things and prone to error as data and types are further apart.
For other values, php provides clearer alternatives such as casting to a double from a string.
Using XML_RPC_Values_* where needed to clarify code is a much better approach, but they should only be used in these cases to limit the amount of objects going around. -Philippe

« previous php.pear.dev (#37611) next »