cvs: peardoc /en/package/webservices/xml-rpc examples.xml
| From: | Daniel Convissor | Date: | Sun, 16 Apr 2006 15:31:36 +0000 |
| Subject: | cvs: peardoc /en/package/webservices/xml-rpc examples.xml | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-7784@lists.php.net to get a copy of this message | ||
danielc Sun Apr 16 15:31:36 2006 UTC
Modified files:
/peardoc/en/package/webservices/xml-rpc examples.xml
Log:
* Fix examples.
http://cvs.php.net/viewcvs.cgi/peardoc/en/package/webservices/xml-rpc/examples.xml?r1=1.12&r2=1.13&diff_format=u
Index: peardoc/en/package/webservices/xml-rpc/examples.xml
diff -u peardoc/en/package/webservices/xml-rpc/examples.xml:1.12
peardoc/en/package/webservices/xml-rpc/examples.xml:1.13
--- peardoc/en/package/webservices/xml-rpc/examples.xml:1.12 Fri Apr 7 20:29:51 2006
+++ peardoc/en/package/webservices/xml-rpc/examples.xml Sun Apr 16 15:31:36 2006
@@ -1,4 +1,4 @@
-<!-- $Revision: 1.12 $ -->
+<!-- $Revision: 1.13 $ -->
<refentry id="package.webservices.xml-rpc.examples">
<refnamediv>
@@ -77,20 +77,16 @@
<![CDATA[
require_once 'XML/RPC/Server.php';
+/*
+ * Declare the functions, etc.
+ */
function returnTimes2($params) {
- $param = $params->getParam(0);
-
- // This error checking syntax was added in Release 1.3.0
- if (!XML_RPC_Value::isValue($param)) {
- return $param;
- }
-
- $val = new XML_RPC_Value($param->scalarval() * 2, 'int');
- return new XML_RPC_Response($val);
+ $obj = new some_class_name;
+ return $obj->returnTimes2($params);
}
class some_class_name {
- returnTimes2($params) {
+ function returnTimes2($params) {
$param = $params->getParam(0);
// This error checking syntax was added in Release 1.3.0
@@ -105,32 +101,26 @@
$some_object = new some_class_name;
-// Here are examples of the various ways to declare "functions":
+
+/*
+ * Establish the dispatch map and XML_RPC server instance.
+ */
$server = new XML_RPC_Server(
array(
- 'function_times2' =>
- array(
- 'function' => 'returnTimes2'
- ),
- ),
- array(
- 'class_paamayim_nekudotayim_times2' =>
- array(
- 'function' => 'some_class_name::returnTimes2'
- ),
- ),
- array(
- 'class_times2' =>
- array(
- 'function' => array('some_class_name' =>
'returnTimes2'),
- ),
- ),
- array(
- 'object_times2' =>
- array(
- 'function' => array($some_object => 'returnTimes2'),
- ),
+ 'function_times2' => array(
+ 'function' => 'returnTimes2'
+ ),
+ 'class_paamayim_nekudotayim_times2' => array(
+ 'function' => 'some_class_name::returnTimes2'
+ ),
+ 'class_times2' => array(
+ 'function' => array('some_class_name', 'returnTimes2')
+ ),
+ 'object_times2' => array(
+ 'function' => array($some_object, 'returnTimes2')
+ ),
),
+ 1 // serviceNow
);
]]>
</programlisting>