cvs: php4 /pear/PEAR Remote.php
| From: | Stig Bakken | Date: | Sun, 28 Apr 2002 07:34:46 +0000 |
| Subject: | cvs: php4 /pear/PEAR Remote.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-3596@lists.php.net to get a copy of this message | ||
ssb Sun Apr 28 03:34:46 2002 EDT
Modified files:
/php4/pear/PEAR Remote.php
Log:
* implemented stub for XML_RPC fallback if xmlrpc-epi is not installed
Index: php4/pear/PEAR/Remote.php
diff -u php4/pear/PEAR/Remote.php:1.17 php4/pear/PEAR/Remote.php:1.18
--- php4/pear/PEAR/Remote.php:1.17 Fri Apr 12 20:13:37 2002
+++ php4/pear/PEAR/Remote.php Sun Apr 28 03:34:46 2002
@@ -16,7 +16,7 @@
// | Author: Stig Bakken <ssb@fast.no> |
// +----------------------------------------------------------------------+
//
-// $Id: Remote.php,v 1.17 2002/04/13 00:13:37 ssb Exp $
+// $Id: Remote.php,v 1.18 2002/04/28 07:34:46 ssb Exp $
require_once 'PEAR.php';
require_once 'PEAR/Config.php';
@@ -47,9 +47,46 @@
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);