From 06b36e7e21f325835f899f6abc3255d95a832e61 Mon Sep 17 00:00:00 2001 From: ggiunta Date: Wed, 5 Aug 2009 09:58:08 +0000 Subject: [PATCH] - improve compatibility with php 5.0.x git-svn-id: https://svn.code.sf.net/p/phpxmlrpc/code/trunk/xmlrpc@48 013ecfd8-0664-425d-a759-9c98391dc3f9 --- lib/xmlrpc_wrappers.inc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/xmlrpc_wrappers.inc b/lib/xmlrpc_wrappers.inc index f96edd5..d4099f2 100644 --- a/lib/xmlrpc_wrappers.inc +++ b/lib/xmlrpc_wrappers.inc @@ -158,6 +158,10 @@ } $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]))) @@ -174,6 +178,11 @@ $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 { @@ -231,7 +240,8 @@ error_log('XML-RPC: method to be wrapped is the constructor: '.$plainfuncname); return false; } - if($func->isDestructor()) + // php 503 always says isdestructor = true... + if( version_compare(phpversion(), '5.0.3') != 0 && $func->isDestructor()) { error_log('XML-RPC: method to be wrapped is the destructor: '.$plainfuncname); return false; -- 2.43.0