From a7ec09076498a752784705b229ea713e9f26a377 Mon Sep 17 00:00:00 2001 From: froschdesign Date: Sun, 14 Feb 2016 16:36:35 +0100 Subject: [PATCH] [Docs] - Fixes #6 - Check All Headers In Documentation --- doc/book/zend.xmlrpc.client.md | 14 +++++++------- doc/book/zend.xmlrpc.server.md | 22 +++++++++++----------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/doc/book/zend.xmlrpc.client.md b/doc/book/zend.xmlrpc.client.md index 304c80f..075a510 100644 --- a/doc/book/zend.xmlrpc.client.md +++ b/doc/book/zend.xmlrpc.client.md @@ -16,7 +16,7 @@ To call a remote method with the *XML-RPC* client, instantiate it and use the `c method. The code sample below uses a demonstration *XML-RPC* server on the Zend Framework website. You can use it for testing or exploring the `Zend\XmlRpc` components. -**XML-RPC Method Call** +### XML-RPC Method Call ```php $client = new Zend\XmlRpc\Client('http://framework.zend.com/xmlrpc'); @@ -34,7 +34,7 @@ The first parameter of the `call()` method receives the name of the remote metho remote method requires any parameters, these can be sent by supplying a second, optional parameter to `call()` with an `Array` of values to pass to the remote method: -**XML-RPC Method Call with Parameters** +### XML-RPC Method Call with Parameters ```php $client = new Zend\XmlRpc\Client('http://framework.zend.com/xmlrpc'); @@ -117,7 +117,7 @@ To instantiate a server proxy, call the `getProxy()` instance method of `Zend\Xm will return an instance of `Zend\XmlRpc\Client\ServerProxy`. Any method call on the server proxy object will be forwarded to the remote, and parameters may be passed like any other *PHP* method. -**Proxy the Default Namespace** +### Proxy the Default Namespace ```php $client = new Zend\XmlRpc\Client('http://framework.zend.com/xmlrpc'); @@ -131,7 +131,7 @@ The `getProxy()` method receives an optional argument specifying which namespace server to proxy. If it does not receive a namespace, the default namespace will be proxied. In the next example, the 'test' namespace will be proxied: -**Proxy Any Namespace** +### Proxy Any Namespace ```php $client = new Zend\XmlRpc\Client('http://framework.zend.com/xmlrpc'); @@ -156,7 +156,7 @@ independently. If any *HTTP* error occurs, such as the remote *HTTP* server returns a **404 Not Found**, a `Zend\XmlRpc\Client\Exception\HttpException` will be thrown. -**Handling HTTP Errors** +#### Handling HTTP Errors ```php $client = new Zend\XmlRpc\Client('http://foo/404'); @@ -186,7 +186,7 @@ When the `call()` method or the server proxy object is used, an *XML-RPC* fault `Zend\XmlRpc\Client\Exception\FaultException` being thrown. The code and message of the exception will map directly to their respective values in the original *XML-RPC* fault response. -**Handling XML-RPC Faults** +#### Handling XML-RPC Faults ```php $client = new Zend\XmlRpc\Client('http://framework.zend.com/xmlrpc'); @@ -246,7 +246,7 @@ object (`Zend\XmlRpc\Response`). The `doRequest()` method is also available for use directly: -**Processing Request to Response** +### Processing Request to Response ```php $client = new Zend\XmlRpc\Client('http://framework.zend.com/xmlrpc'); diff --git a/doc/book/zend.xmlrpc.server.md b/doc/book/zend.xmlrpc.server.md index 623898b..c63495b 100644 --- a/doc/book/zend.xmlrpc.server.md +++ b/doc/book/zend.xmlrpc.server.md @@ -228,7 +228,7 @@ instance, and then attempts to create a new cache file with the server definitio Below are several usage examples, showing the full spectrum of options available to developers. Usage examples will each build on the previous example provided. -**Basic Usage** +### Basic Usage The example below attaches a function as a dispatchable *XML-RPC* method and handles incoming calls. @@ -249,7 +249,7 @@ $server->addFunction('md5Value'); echo $server->handle(); ``` -**Attaching a class** +### Attaching a class The example below illustrates attaching a class' public methods as dispatchable *XML-RPC* methods. @@ -261,7 +261,7 @@ $server->setClass('Services\Comb'); echo $server->handle(); ``` -**Attaching a class with arguments** +### Attaching a class with arguments The following example illustrates how to attach a class' public methods and passing arguments to its methods. This can be used to specify certain defaults when registering service classes. @@ -297,7 +297,7 @@ The arguments passed at `setClass()` at server construction time are injected in `pricing.calculate()` on remote invokation. In the example above, only the argument `$purchaseId` is expected from the client. -**Passing arguments only to constructor** +### Passing arguments only to constructor `Zend\XmlRpc\Server` allows to restrict argument passing to constructors only. This can be used for constructor dependency injection. To limit injection to constructors, call @@ -339,13 +339,13 @@ $server->setClass('Services\PricingService2', new PurchaseRepository()); ``` -**Attaching a class instance** +### Attaching a class instance `setClass()` allows to register a previously instantiated class at the server. Just pass an instance instead of the class name. Obviously passing arguments to the constructor is not possible with pre-instantiated classes. -**Attaching several classes using namespaces** +### Attaching several classes using namespaces The example below illustrates attaching several classes, each with their own namespace. @@ -361,7 +361,7 @@ $server->setClass('Services\Pick', 'pick'); // methods called as pick.* echo $server->handle(); ``` -**Specifying exceptions to use as valid fault responses** +### Specifying exceptions to use as valid fault responses The example below allows any `Services\Exception`-derived class to report its code and message in the fault response. @@ -382,7 +382,7 @@ $server->setClass('Services\Pick', 'pick'); // methods called as pick.* echo $server->handle(); ``` -**Utilizing custom request and response objects** +### Utilizing custom request and response objects Some use cases require to utilize a custom request object. For example, *XML/RPC* is not bound to *HTTP* as a transfer protocol. It is possible to use other transfer protocols like *SSH* or telnet @@ -413,7 +413,7 @@ $request = new Services\Request(); echo $server->handle($request); ``` -**Specifying a custom response class** +### Specifying a custom response class The example below illustrates specifying a custom response class for the returned response. @@ -444,7 +444,7 @@ echo $server->handle($request); ## Performance optimization -**Cache server definitions between requests** +### Cache server definitions between requests The example below illustrates caching server definitions between requests. @@ -486,7 +486,7 @@ echo $server->handle($request); > ## Note The server cache file should be located outside the document root. -**Optimizing XML generation** +### Optimizing XML generation `Zend\XmlRpc\Server` uses `DOMDocument` of *PHP* extension **ext/dom** to generate it's *XML* output. While **ext/dom** is available on a lot of hosts it is not exactly the fastest. Benchmarks