1
0

XmlRPC-bootstrap.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <?php
  2. /**
  3. * @author Gaetano Giunta
  4. * @copyright (c) 2020 G. Giunta
  5. * @license code licensed under the BSD License: see license.txt
  6. */
  7. include_once 'XmlRPC.php';
  8. use PhpXmlRpc\Polyfill\XmlRpc as p;
  9. if (!function_exists('xmlrpc_decode')) {
  10. /**
  11. * @param string $xml
  12. * @param string $encoding
  13. * @return mixed
  14. */
  15. function xmlrpc_decode($xml, $encoding = "iso-8859-1") { return p\XmlRpc::xmlrpc_decode($xml, $encoding); }
  16. }
  17. if (!function_exists('xmlrpc_decode_request')) {
  18. /**
  19. * @param string $xml
  20. * @param string $method
  21. * @param string $encoding
  22. * @return mixed
  23. */
  24. function xmlrpc_decode_request($xml, &$method, $encoding = "iso-8859-1") { return p\XmlRpc::xmlrpc_decode_request($xml, $method, $encoding); }
  25. }
  26. if (!function_exists('xmlrpc_encode')) {
  27. /**
  28. * @param mixed $value
  29. * @return string
  30. */
  31. function xmlrpc_encode($value) { return p\XmlRpc::xmlrpc_encode($value); }
  32. }
  33. if (!function_exists('xmlrpc_encode_request')) {
  34. /**
  35. * @param string $method
  36. * @param mixed $params
  37. * @param array $output_options
  38. * @return string
  39. */
  40. function xmlrpc_encode_request($method, $params, $output_options = array()) { return p\XmlRpc::xmlrpc_encode_request($method, $params, $output_options); }
  41. }
  42. if (!function_exists('xmlrpc_get_type')) {
  43. /**
  44. * @param mixed $value
  45. * @return string
  46. */
  47. function xmlrpc_get_type($value) { return p\XmlRpc::xmlrpc_get_type($value); }
  48. }
  49. if (!function_exists('xmlrpc_is_fault')) {
  50. /**
  51. * @param array $arg
  52. * @return bool
  53. */
  54. function xmlrpc_is_fault($arg) { return p\XmlRpc::xmlrpc_is_fault($arg); }
  55. }
  56. if (!function_exists('xmlrpc_parse_method_descriptions')) {
  57. /**
  58. * @param string $xml
  59. * @return array
  60. */
  61. function xmlrpc_parse_method_descriptions($xml) { return p\XmlRpc::xmlrpc_parse_method_descriptions($xml); }
  62. }
  63. if (!function_exists('xmlrpc_server_add_introspection_data')) {
  64. /**
  65. * @param \PhpXmlrpc\Server $server
  66. * @param array $desc
  67. * @return int
  68. */
  69. function xmlrpc_server_add_introspection_data($server, $desc) { return p\XmlRpc::xmlrpc_server_add_introspection_data($server, $desc); }
  70. }
  71. if (!function_exists('xmlrpc_server_call_method')) {
  72. /**
  73. * @param \PhpXmlrpc\Server $server
  74. * @param string $xml
  75. * @param mixed $user_data
  76. * @param array $output_options
  77. * @return string
  78. */
  79. function xmlrpc_server_call_method($server, $xml, $user_data, $output_options = array()) { return p\XmlRpc::xmlrpc_server_call_method($server, $xml, $user_data, $output_options); }
  80. }
  81. if (!function_exists('xmlrpc_server_create')) {
  82. /**
  83. * @return \PhpXmlrpc\Server
  84. */
  85. function xmlrpc_server_create() { return p\XmlRpc::xmlrpc_server_create(); }
  86. }
  87. if (!function_exists('xmlrpc_server_destroy')) {
  88. /**
  89. * @param \PhpXmlrpc\Server $server
  90. * @return int
  91. */
  92. function xmlrpc_server_destroy($server) { return p\XmlRpc::xmlrpc_server_destroy($server); }
  93. }
  94. if (!function_exists('xmlrpc_server_register_introspection_callback')) {
  95. /**
  96. * @param \PhpXmlrpc\Server $server
  97. * @param string $function
  98. * @return bool
  99. */
  100. function xmlrpc_server_register_introspection_callback($server, $function) { return p\XmlRpc::xmlrpc_server_register_introspection_callback($server, $function); }
  101. }
  102. if (!function_exists('xmlrpc_server_register_method')) {
  103. /**
  104. * @param \PhpXmlrpc\Server $server
  105. * @param string $method_name
  106. * @param string $function
  107. * @return bool
  108. */
  109. function xmlrpc_server_register_method($server, $method_name, $function) { return p\XmlRpc::xmlrpc_server_register_method($server, $method_name, $function); }
  110. }
  111. if (!function_exists('xmlrpc_set_type')) {
  112. /**
  113. * @param string $value
  114. * @param string $type
  115. * @return bool
  116. */
  117. function xmlrpc_set_type(&$value, $type) { return p\XmlRpc::xmlrpc_set_type($value, $type); }
  118. }