PageRenderTime 29ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/examples/jsonrpc/public/services/phpolait/rpcproxy.php5

http://pyjamas.googlecode.com/
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. * Proxy class for making JSON RPC calls.
  9. *
  10. * Provides the ability to make JSON Rpc Proxy calls to remote servers.
  11. */
  12. class JSONRpcProxy {
  13. // {{{ properties
  14. /**
  15. * Contains the URL for the server.
  16. *
  17. * @var string
  18. * @access protected
  19. */
  20. var $url;
  21. /**
  22. * The HTTP Wrapper.
  23. */
  24. var $httpWrap;
  25. /**
  26. * Associative array of configuration data as per the config parameter to JSONRpcServer
  27. */
  28. var $jsonlib;
  29. // }}}
  30. /**
  31. * @param string $url The URL of the server.
  32. * @param object $httpWrapper A custom HTTPWrapper class.
  33. * @param string $jsonlib Path to the JSON.php file, if using.
  34. */
  35. function JSONRpcProxy($url, $httpWrapper=null, $jsonlib=null) {
  36. include("rpcproxy_constructor.php");
  37. }
  38. /**
  39. * Function overloading ensures that any method calls on RemoteProxy will come to this method.
  40. * @param string $method The name of the method being called.
  41. * @param Array $args Array of parameters
  42. * @param ref $return Return value from the call
  43. * @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
  44. * third value gives the actual text returned from the server.
  45. * Example
  46. * list($result, $error, $returnText) = $proxy->echo('This is a test');
  47. */
  48. function __call($method, $args) {
  49. include ("rpcproxy_call_method.php");
  50. return $return;
  51. }
  52. }
  53. // }}} JSONRpcProxy
  54. ?>