Re: proposal for extending XML/RPC.php

From: Date: Wed, 10 Mar 2004 10:33:21 +0000
Subject: Re: proposal for extending XML/RPC.php
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-26249@lists.php.net to get a copy of this message
On Wed Mar 10, 2004 at 10:4012AM +0100, Sebastien Person wrote: > I use the XML-RPC functions of the pear lib. I saw that there were possibility > to ask xml webservices for documentation and signature string. > If the XML_RPC_Client class could provide an easy way to find all available > method from a web service and also provide it's documentation and signature it > would be an interesting function for developpers involving with xml rpc. > So I added a discover() method to this class wich when called, print out all > these informations. Maybe this could interest some other people so I post it to > the list. The patch sounds useful. I haven't tested it yet, but I already have a number of comments. (See below.) > /** > * private : list parameters for a given signature > */ > function sig_details($sig) > { > if ($sig->KindOf() == "array"){ > > echo "<pre style=\"background-color:#cccccc;\">"; Please do not use HTML markup in PEAR packages: This will be a problem, if one wants to use XML_RPC in applications that are not built with HTML (like command line or Gtk applications) or that have to following strict style guidelines, which e.g. do not allow grey backgrounds. > // loop throught all available parameters > $number_of_param = $sig->arraysize(); > for ($i=0 ; $i<$number_of_param; $i++){ > $param = $sig->arraymem($i); > $param_scalarval = $param->scalarval(); > if ($i == 0) > echo "\nouput : " . $param_scalarval; > else > echo "\ninput : " . $param_scalarval; > } > echo "</pre>"; > } > } Your patch does not strictly follow the PEAR coding standards, which are described on http://pear.php.net/manual/en/standards.php. This is quite easy to fix though. -- - Martin Martin Jansen http://martinjansen.com/

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