X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fxmlrpc_wrappers.inc;h=1fbf5ceac973bd4259b464b8fcaecb771a1bb897;hb=dd3de5570489cd2bdf44afaa7efac759d19c6e9c;hp=4a923483af028159ff9b46c88da9ddb3f59d6dc6;hpb=90101b1e9ea537c0c788dcf2f5fc0c752681c7a0;p=plcapi.git diff --git a/lib/xmlrpc_wrappers.inc b/lib/xmlrpc_wrappers.inc index 4a92348..1fbf5ce 100644 --- a/lib/xmlrpc_wrappers.inc +++ b/lib/xmlrpc_wrappers.inc @@ -105,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: @@ -149,14 +148,7 @@ $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); @@ -177,11 +169,6 @@ $plainfuncname = get_class($funcname[0]) . '->' . $funcname[1]; } $exists = method_exists($funcname[0], $funcname[1]); - if (!$exists && version_compare(phpversion(), '5.1') < 0) - { - // workaround for php 5.0: static class methods are not seen by method_exists - $exists = is_callable( $funcname ); - } } else { @@ -239,8 +226,7 @@ error_log('XML-RPC: method to be wrapped is the constructor: '.$plainfuncname); return false; } - // php 503 always says isdestructor = true... - if( version_compare(phpversion(), '5.0.3') != 0 && $func->isDestructor()) + if($func->isDestructor()) { error_log('XML-RPC: method to be wrapped is the destructor: '.$plainfuncname); return false; @@ -500,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)