gehe zum Quellcode dieser Datei
Funktionen | |
php_2_xmlrpc_type ($phptype) | |
xmlrpc_2_php_type ($xmlrpctype) | |
wrap_php_function ($funcname, $newfuncname='', $extra_options=array()) | |
wrap_php_class ($classname, $extra_options=array()) | |
wrap_xmlrpc_method ($client, $methodname, $extra_options=0, $timeout=0, $protocol='', $newfuncname='') | |
wrap_xmlrpc_server ($client, $extra_options=array()) | |
build_remote_method_wrapper_code ($client, $methodname, $xmlrpcfuncname, $msig, $mdesc='', $timeout=0, $protocol='', $client_copy_mode=0, $prefix='xmlrpc', $decode_php_objects=false, $encode_php_objects=false, $decode_fault=false, $fault_response='') | |
build_client_wrapper_code ($client, $verbatim_client_copy, $prefix='xmlrpc') |
build_client_wrapper_code | ( | $ | client, | |
$ | verbatim_client_copy, | |||
$ | prefix = 'xmlrpc' | |||
) |
Given necessary info, generate php code that will rebuild a client object Take care that no full checking of input parameters is done to ensure that valid php code is emitted. private
Definiert in Zeile 921 der Datei xmlrpc_wrappers.inc.
Wird benutzt von build_remote_method_wrapper_code() und wrap_xmlrpc_server().
build_remote_method_wrapper_code | ( | $ | client, | |
$ | methodname, | |||
$ | xmlrpcfuncname, | |||
$ | msig, | |||
$ | mdesc = '' , |
|||
$ | timeout = 0 , |
|||
$ | protocol = '' , |
|||
$ | client_copy_mode = 0 , |
|||
$ | prefix = 'xmlrpc' , |
|||
$ | decode_php_objects = false , |
|||
$ | encode_php_objects = false , |
|||
$ | decode_fault = false , |
|||
$ | fault_response = '' | |||
) |
Given the necessary info, build php code that creates a new function to invoke a remote xmlrpc method. Take care that no full checking of input parameters is done to ensure that valid php code is emitted. Note: real spaghetti code follows... private
Definiert in Zeile 819 der Datei xmlrpc_wrappers.inc.
Benutzt build_client_wrapper_code().
Wird benutzt von wrap_xmlrpc_method().
php_2_xmlrpc_type | ( | $ | phptype | ) |
PHP-XMLRPC "wrapper" functions Generate stubs to transparently access xmlrpc methods as php functions and viceversa
use some better templating system for code generation?
implement method wrapping with preservation of php objs in calls
when wrapping methods without obj rebuilding, use return_type = 'phpvals' (faster)
implement self-parsing of php code for PHP <= 4
string | $phptype |
Definiert in Zeile 28 der Datei xmlrpc_wrappers.inc.
Benutzt $GLOBALS.
Wird benutzt von _xmlrpcs_multicall_do_call_phpvals() und wrap_php_function().
wrap_php_class | ( | $ | classname, | |
$ | extra_options = array() | |||
) |
Given a user-defined PHP class or php object, map its methods onto a list of PHP 'wrapper' functions that can be exposed as xmlrpc methods from an xmlrpc_server object and called from remote clients (as well as their corresponding signature info).
mixed | $classname the name of the class whose methods are to be exposed as xmlrpc methods, or an object instance of that class | |
array | $extra_options see the docs for wrap_php_method for more options string method_type 'static', 'nonstatic', 'all' and 'auto' (default); the latter will switch between static and non-static depending on wheter $classname is a class name or object instance |
Definiert in Zeile 488 der Datei xmlrpc_wrappers.inc.
Benutzt wrap_php_function().
wrap_php_function | ( | $ | funcname, | |
$ | newfuncname = '' , |
|||
$ | extra_options = array() | |||
) |
Given a user-defined PHP function, create a PHP 'wrapper' function that can be exposed as xmlrpc method from an xmlrpc_server object and called from remote clients (as well as its corresponding signature info).
Since php is a typeless language, to infer types of input and output parameters, it relies on parsing the javadoc-style comment block associated with the given function. Usage of xmlrpc native types (such as datetime.dateTime.iso8601 and base64) in the
tag | is also allowed, if you need the php function to receive/send data in that particular format (note that base64 encoding/decoding is transparently carried out by the lib, while datetime vals are passed around as strings) |
tags | using param names in a different order from the function prototype is not considered valid (to be fixed?) |
string | $funcname the name of the PHP user function to be exposed as xmlrpc method; array($obj, 'methodname') and array('class', 'methodname') are ok too | |
string | $newfuncname (optional) name for function to be created | |
array | $extra_options (optional) array of options for conversion. valid values include: bool return_source when true, php code w. function definition will be returned, not evaluated bool encode_php_objs let php objects be sent to server using the 'improved' xmlrpc notation, so server can deserialize them as php objects bool decode_php_objs --- WARNING !!! possible security hazard. only use it with trusted servers --- bool suppress_warnings remove from produced xml any runtime warnings due to the php function being invoked |
finish using javadoc info to build method sig if all params are named but out of order
add a check for params of 'resource' type
add some trigger_errors / error_log when returning false?
what to do when the PHP function returns NULL? we are currently returning an empty string value...
add an option to suppress php warnings in invocation of user function, similar to server debug level 3?
if $newfuncname is empty, we could use create_user_func instead of eval, as it is possibly faster
add a verbatim_object_copy parameter to allow avoiding the same obj instance?
Definiert in Zeile 144 der Datei xmlrpc_wrappers.inc.
Benutzt $GLOBALS und php_2_xmlrpc_type().
Wird benutzt von wrap_php_class().
wrap_xmlrpc_method | ( | $ | client, | |
$ | methodname, | |||
$ | extra_options = 0 , |
|||
$ | timeout = 0 , |
|||
$ | protocol = '' , |
|||
$ | newfuncname = '' | |||
) |
Given an xmlrpc client and a method name, register a php wrapper function that will call it and return results using native php types for both params and results. The generated php function will return an xmlrpcresp oject for failed xmlrpc calls
Known limitations:
Notes: the connection properties of the given client will be copied and reused for the connection used during the call to the generated php function. Calling the generated php function 'might' be slow: a new xmlrpc client is created on every invocation and an xmlrpc-connection opened+closed. An extra 'debug' param is appended to param list of xmlrpc method, useful for debugging purposes.
xmlrpc_client | $client an xmlrpc client set up correctly to communicate with target server | |
string | $methodname the xmlrpc method to be mapped to a php function | |
array | $extra_options array of options that specify conversion details. valid ptions include integer signum the index of the method signature to use in mapping (if method exposes many sigs) integer timeout timeout (in secs) to be used when executing function/calling remote method string protocol 'http' (default), 'http11' or 'https' string new_function_name the name of php function to create. If unsepcified, lib will pick an appropriate name string return_source if true return php code w. function definition instead fo function name bool encode_php_objs let php objects be sent to server using the 'improved' xmlrpc notation, so server can deserialize them as php objects bool decode_php_objs --- WARNING !!! possible security hazard. only use it with trusted servers --- mixed return_on_fault a php value to be returned when the xmlrpc call fails/returns a fault response (by default the xmlrpcresp object is returned in this case). If a string is used, 'faultCode' and 'faultString' tokens will be substituted with actual error values bool debug set it to 1 or 2 to see debug results of querying server for method synopsis |
Definiert in Zeile 562 der Datei xmlrpc_wrappers.inc.
Benutzt build_remote_method_wrapper_code().
Wird benutzt von wrap_xmlrpc_server().
wrap_xmlrpc_server | ( | $ | client, | |
$ | extra_options = array() | |||
) |
Similar to wrap_xmlrpc_method, but will generate a php class that wraps all xmlrpc methods exposed by the remote server as own methods. For more details see wrap_xmlrpc_method.
xmlrpc_client | $client the client obj all set to query the desired server | |
array | $extra_options list of options for wrapped code |
Definiert in Zeile 701 der Datei xmlrpc_wrappers.inc.
Benutzt build_client_wrapper_code() und wrap_xmlrpc_method().
xmlrpc_2_php_type | ( | $ | xmlrpctype | ) |
Given a string defining a phpxmlrpc type return corresponding php type.
string | $xmlrpctype |
Definiert in Zeile 69 der Datei xmlrpc_wrappers.inc.
Benutzt $GLOBALS.
Copyright © 2003 - 2009 MyOOS [Shopsystem]. All rights reserved. MyOOS [Shopsystem] is Free Software released under the GNU/GPL License. Webmaster: info@r23.de (Impressum) |
|