/examples/jsonrpc/public/services/phpolait/rpcproxy.php4
PHP | 63 lines | 15 code | 8 blank | 40 comment | 0 complexity | f4e04dbfffa4e82fad5f2c5fed7f845c MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0
1<?php
2 /**
3 * PHP4 definitions for JSONRpcProxy
4 * Function implementations are in rpcproxy_constructor.php and rpcproxy_call_method.php - a brave attempt to maintain a
5 * single code-base.
6 */
7
8/**
9 * Proxy class for making JSON RPC calls.
10 *
11 * Provides the ability to make JSON Rpc Proxy calls to remote servers.
12 */
13class JSONRpcProxy {
14 // {{{ properties
15 /**
16 * Contains the URL for the server.
17 *
18 * @var string
19 * @access protected
20 */
21 var $url;
22
23 /**
24 * The HTTP Wrapper.
25 */
26 var $httpWrap;
27
28 /**
29 * Associative array of configuration data as per the config parameter to JSONRpcServer
30 */
31 var $jsonlib;
32 // }}}
33
34
35 /**
36 * @param string $url The URL of the server.
37 * @param object $httpWrapper A custom HTTPWrapper class.
38 * @param string $jsonlib Path to the JSON.php file, if using.
39 */
40 function JSONRpcProxy($url, $httpWrapper=null, $jsonlib=null) {
41 include("rpcproxy_constructor.php");
42 }
43
44 /**
45 * Function overloading ensures that any method calls on RemoteProxy will come to this method.
46 * @param string $method The name of the method being called.
47 * @param Array $args Array of parameters
48 * @param ref $return Return value from the call
49 * @return Array First element is the return value (if any) from the server, second element is the error value (null if no error occured). If an error occured, a
50 * third value gives the actual text returned from the server.
51 * Example
52 * list($result, $error, $returnText) = $proxy->echo('This is a test');
53 */
54 function __call($method, $args, &$return) {
55 include ("rpcproxy_call_method.php");
56 return true;
57 }
58}
59
60overload("JSONRpcProxy");
61
62// }}} JSONRpcProxy
63?>