X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fxmlrpc_wrappers.inc;h=1fbf5ceac973bd4259b464b8fcaecb771a1bb897;hb=4d3f0dd566fa18a47ffc4e7e46e6c51785f56013;hp=f96edd57cef507ecdc5e2d583addc88925164760;hpb=98d7e6896c6fb90552adf0d841f2e3094a167e16;p=plcapi.git diff --git a/lib/xmlrpc_wrappers.inc b/lib/xmlrpc_wrappers.inc index f96edd5..1fbf5ce 100644 --- a/lib/xmlrpc_wrappers.inc +++ b/lib/xmlrpc_wrappers.inc @@ -3,9 +3,8 @@ * PHP-XMLRPC "wrapper" functions * Generate stubs to transparently access xmlrpc methods as php functions and viceversa * - * @version $Id: xmlrpc_wrappers.inc,v 1.13 2008/09/20 01:23:47 ggiunta Exp $ * @author Gaetano Giunta - * @copyright (C) 2006-2009 G. Giunta + * @copyright (C) 2006-2014 G. Giunta * @license code licensed under the BSD License: http://phpxmlrpc.sourceforge.net/license.txt * * @todo separate introspection from code generation for func-2-method wrapping @@ -106,7 +105,6 @@ * carried out by the lib, while datetime vals are passed around as strings) * * Known limitations: - * - requires PHP 5.0.3 + * - only works for user-defined functions, not for PHP internal functions * (reflection does not support retrieving number/type of params for those) * - functions returning php objects will generate special xmlrpc responses: @@ -150,14 +148,11 @@ $decode_php_objects = isset($extra_options['decode_php_objs']) ? (bool)$extra_options['decode_php_objs'] : false; $catch_warnings = isset($extra_options['suppress_warnings']) && $extra_options['suppress_warnings'] ? '@' : ''; - if(version_compare(phpversion(), '5.0.3') == -1) - { - // up to php 5.0.3 some useful reflection methods were missing - error_log('XML-RPC: cannot not wrap php functions unless running php version bigger than 5.0.3'); - return false; - } - - $exists = false; + $exists = false; + if (is_string($funcname) && strpos($funcname, '::') !== false) + { + $funcname = explode('::', $funcname); + } if(is_array($funcname)) { if(count($funcname) < 2 || (!is_string($funcname[0]) && !is_object($funcname[0]))) @@ -231,7 +226,7 @@ error_log('XML-RPC: method to be wrapped is the constructor: '.$plainfuncname); return false; } - if($func->isDestructor()) + if($func->isDestructor()) { error_log('XML-RPC: method to be wrapped is the destructor: '.$plainfuncname); return false; @@ -491,13 +486,6 @@ $methodfilter = isset($extra_options['method_filter']) ? $extra_options['method_filter'] : ''; $methodtype = isset($extra_options['method_type']) ? $extra_options['method_type'] : 'auto'; - if(version_compare(phpversion(), '5.0.3') == -1) - { - // up to php 5.0.3 some useful reflection methods were missing - error_log('XML-RPC: cannot not wrap php functions unless running php version bigger than 5.0.3'); - return false; - } - $result = array(); $mlist = get_class_methods($classname); foreach($mlist as $mname)