cvs: peardoc /en/package/webservices/xml-rpc2 intro.xml
| From: | Christian Weiske | Date: | Mon, 04 Dec 2006 20:19:50 +0000 |
| Subject: | cvs: peardoc /en/package/webservices/xml-rpc2 intro.xml | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-9000@lists.php.net to get a copy of this message | ||
cweiske Mon Dec 4 20:19:50 2006 UTC
Modified files:
/peardoc/en/package/webservices/xml-rpc2 intro.xml
Log:
Remove some unnecessary spaces and most important
wrap lines so that the manual doesn't need a 1400xX
screen resolution
http://cvs.php.net/viewvc.cgi/peardoc/en/package/webservices/xml-rpc2/intro.xml?r1=1.4&r2=1.5&diff_format=u
Index: peardoc/en/package/webservices/xml-rpc2/intro.xml
diff -u peardoc/en/package/webservices/xml-rpc2/intro.xml:1.4
peardoc/en/package/webservices/xml-rpc2/intro.xml:1.5
--- peardoc/en/package/webservices/xml-rpc2/intro.xml:1.4 Sat Apr 22 11:43:21 2006
+++ peardoc/en/package/webservices/xml-rpc2/intro.xml Mon Dec 4 20:19:50 2006
@@ -1,4 +1,4 @@
-<!-- $Revision: 1.4 $ -->
+<!-- $Revision: 1.5 $ -->
<refentry id="package.webservices.xml-rpc2.intro">
<refnamediv>
@@ -52,7 +52,7 @@
be really usefull especially on public XMLRPC servers.
</para>
</refsect1>
-
+
<refsect1 id="package.webservices.xml-rpc2.intro.requirements">
<title>Requirements</title>
<para>
@@ -75,13 +75,13 @@
</listitem>
<listitem>
<para>
- PHP, which doesn't need the XMLRPCEXT extension at all (this is full PHP
+ PHP, which doesn't need the XMLRPCEXT extension at all (this is full PHP
but slower).
</para>
</listitem>
</itemizedlist>
</refsect1>
-
+
<refsect1 id="package.webservices.xml-rpc2.intro.exampleclient">
<title>A first example of the client side use</title>
<para>
@@ -104,9 +104,9 @@
// Because of the prefix specified in the $options array, indeed, we will call
// the package.info() method with a single argument (the string 'XML_RPC2')
- $result = $client->info('XML_RPC2');
-
- // $result is a complex PHP type (no XMLRPC decoding needed, it's already done)
+ $result = $client->info('XML_RPC2');
+
+ // $result is a complex PHP type (no XMLRPC decoding needed, it's already done)
print_r($result);
} catch (XML_RPC2_FaultException $e) {
@@ -114,7 +114,7 @@
// The XMLRPC server returns a XMLRPC error
die('Exception #' . $result->getFaultCode() . ' : ' .
$e->getFaultString());
-} catch (Exception $e) {
+} catch (Exception $e) {
// Other errors (HTTP or networking problems...)
die('Exception : ' . $e->getFaultString());
@@ -151,7 +151,7 @@
public static function echoecho($string) {
return $string;
}
-
+
}
$options = array(
@@ -185,12 +185,14 @@
require_once 'XML/RPC2/CachedClient.php';
$options = array(
- 'prefix' => 'package.',
- 'cacheDebug' => false, // with cacheDebug set to true, it's very easy to get
an indication about the cache using (or not)
+ 'prefix' => 'package.',
+ 'cacheDebug' => false, // with cacheDebug set to true, it's very easy
+ // to get an indication about the cache using (or not)
'cacheOptions' => array(
'cacheDir' => '/tmp/',
'lifetime' => 3600, // during this lifetime, the local cache will be used
- 'cacheByDefault' => true // all methods call will be cached (but a more
precise way is possible)
+ 'cacheByDefault' => true // all methods call will be cached
+ // (but a more precise way is possible)
)
);
@@ -200,20 +202,20 @@
try {
// First call, the cache won't be used
- $result = $client->info('XML_RPC2');
+ $result = $client->info('XML_RPC2');
print_r($result);
-
+
// Second call, the cache will be used (in a transparent way) and no
// additional HTTP request will be sent to the server
- $result = $client->info('XML_RPC2');
- print_r($result);
+ $result = $client->info('XML_RPC2');
+ print_r($result);
} catch (XML_RPC2_FaultException $e) {
// The XMLRPC server returns a XMLRPC error
die('Exception #' . $result->getFaultCode() . ' : ' .
$e->getFaultString());
-} catch (Exception $e) {
+} catch (Exception $e) {
// Other errors (HTTP or networking problems...)
die('Exception : ' . $e->getFaultString());
@@ -222,25 +224,26 @@
?>
]]>
- </programlisting>
+ </programlisting>
</para>
</refsect1>
-
+
<refsect1 id="package.webservices.xml-rpc2.intro.examplecachedserver">
<title>A first example of the server side use (with integrated cache)</title>
<para>
As the caching process is completely transparent, this is very similar to the standard server
side use :
<programlisting role="php">
- <![CDATA[
- <?php
-
+ <![CDATA[
+<?php
+
require_once 'XML/RPC2/CachedServer.php';
// Let's define a class with public static methods
// PHPDOC comments are really important because they are used for automatic
// signature checking
-// IMPORTANT : note the @xmlrpc.caching PHPDOC tags to indicate that the method has to be cached
+// IMPORTANT : note the @xmlrpc.caching PHPDOC tags to indicate
+// that the method has to be cached
class EchoServer {
@@ -254,17 +257,18 @@
public static function echoecho($string) {
return $string;
}
-
-}
+
+}
$options = array(
- 'prefix' => 'test..',
- 'cacheDebug' => false, // with cacheDebug set to true, it's very easy to get
an indication about the cache using (or not)
- 'cacheOptions' => array(
- 'cacheDir' => '/tmp/',
- 'lifetime' => 3600,
+ 'prefix' => 'test..',
+ 'cacheDebug' => false, // with cacheDebug set to true, it's very easy
+ // to get an indication about the cache using (or not)
+ 'cacheOptions' => array(
+ 'cacheDir' => '/tmp/',
+ 'lifetime' => 3600,
'cacheByDefault' => false // we don't cache by default (only methods with
@xmlrpc.caching true)
- )
+ )
);
$server = XML_RPC2_CachedServer::create('EchoServer', $options);
@@ -272,8 +276,8 @@
?>
]]>
- </programlisting>
- </para>
+ </programlisting>
+ </para>
</refsect1>
</refentry>