From: Stig Bakken Date: Sun, 28 Apr 2002 07:34:46 +0000 (+0000) Subject: * implemented stub for XML_RPC fallback if xmlrpc-epi is not installed X-Git-Tag: php-4.3.0dev-ZendEngine2-Preview1~387 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e08fb72a0c82c8fad829c175a9047769a1019cda;p=php * implemented stub for XML_RPC fallback if xmlrpc-epi is not installed --- diff --git a/pear/PEAR/Remote.php b/pear/PEAR/Remote.php index 4b8bd7bdef..51d2e75c1c 100644 --- a/pear/PEAR/Remote.php +++ b/pear/PEAR/Remote.php @@ -47,9 +47,46 @@ class PEAR_Remote extends PEAR function call($method) { - if (!extension_loaded("xmlrpc")) { - return $this->raiseError("xmlrpc support not loaded"); + if (extension_loaded("xmlrpc")) { + $args = func_get_args(); + return call_user_func_array(array(&$this, 'call_epi'), $args); } + if (!include_once("XML/RPC.php")) { + return $this->raiseError("XML_RPC package not installed"); + } + return $this->raiseError("XML_RPC fallback not yet implemented"); + } + + // }}} + + // {{{ call_epi(method, [args...]) + + function call_epi($method) + { + do { + if (extension_loaded("xmlrpc")) { + break; + } + if (OS_WINDOWS) { + $ext = 'dll'; + } elseif (PHP_OS == 'HP-UX') { + $ext = 'sl'; + } elseif (PHP_OS == 'AIX') { + $ext = 'a'; + } else { + $ext = 'so'; + } + $ext = OS_WINDOWS ? 'dll' : 'so'; + @dl("xmlrpc-epi.$ext"); + if (extension_loaded("xmlrpc")) { + break; + } + @dl("xmlrpc.$ext"); + if (extension_loaded("xmlrpc")) { + break; + } + return $this->raiseError("xmlrpc extension not loaded"); + } while (false); $params = func_get_args(); array_shift($params); $method = str_replace("_", ".", $method);