cvs: php4 /pear/PEAR Remote.php
| From: | Stig Bakken | Date: | Mon, 10 Dec 2001 17:04:56 +0000 |
| Subject: | cvs: php4 /pear/PEAR Remote.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-1505@lists.php.net to get a copy of this message | ||
ssb Mon Dec 10 12:04:56 2001 EDT
Modified files:
/php4/pear/PEAR Remote.php
Log:
* now using ext/overload
# how to use:
#
# $remote = new PEAR_Remote;
# $remote->package_listAll();
# $remote->user_activate("johndoe");
#
# (when using overloading, "_" is replaced with "." before doing
# the xmlrpc call)
Index: php4/pear/PEAR/Remote.php
diff -u php4/pear/PEAR/Remote.php:1.4 php4/pear/PEAR/Remote.php:1.5
--- php4/pear/PEAR/Remote.php:1.4 Wed Oct 31 01:21:10 2001
+++ php4/pear/PEAR/Remote.php Mon Dec 10 12:04:56 2001
@@ -17,7 +17,7 @@
// | |
// +----------------------------------------------------------------------+
//
-// $Id: Remote.php,v 1.4 2001/10/31 06:21:10 ssb Exp $
+// $Id: Remote.php,v 1.5 2001/12/10 17:04:56 ssb Exp $
require_once 'PEAR.php';
@@ -47,10 +47,21 @@
function call($method)
{
+ $args = func_get_args();
+ array_shift($args);
+ return $this->__call($method, $args);
+ }
+
+ // }}}
+
+ // {{{ __call(method, args)
+
+ function __call($method, $params)
+ {
if (!extension_loaded("xmlrpc")) {
return $this->raiseError("xmlrpc support not loaded");
}
- $params = array_slice(func_get_args(), 1);
+ $method = str_replace("_", ".", $method);
$request = xmlrpc_encode_request($method, $params);
$server_host = $this->config_object->get("master_server");
if (empty($server_host)) {
@@ -98,5 +109,7 @@
// }}}
}
+
+overload("PEAR_Remote");
?>