/examples/dynamictable/public/phpolait/rpcproxy.php5
PHP | 61 lines | 14 code | 7 blank | 40 comment | 0 complexity | 23380ad241d558f56bd81637a8accabd MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0
1<?php 2 /** 3 * PHP5 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) { 55 include ("rpcproxy_call_method.php"); 56 return $return; 57 } 58} 59 60// }}} JSONRpcProxy 61?>