diff options
author | Stig Bakken <ssb@php.net> | 2001-12-10 17:04:56 +0000 |
---|---|---|
committer | Stig Bakken <ssb@php.net> | 2001-12-10 17:04:56 +0000 |
commit | 79f5dcf7d6c985d86655faf235543246389cc123 (patch) | |
tree | e1cafd4b1bb640a42111209c2b34d77c9dba6588 | |
parent | b26e4a97c9e8d68d71d4bbeeb4bc6b1a9a15a9c6 (diff) | |
download | php-git-79f5dcf7d6c985d86655faf235543246389cc123.tar.gz |
* 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)
-rw-r--r-- | pear/PEAR/Remote.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/pear/PEAR/Remote.php b/pear/PEAR/Remote.php index 920c2d68aa..c89aeff080 100644 --- a/pear/PEAR/Remote.php +++ b/pear/PEAR/Remote.php @@ -47,10 +47,21 @@ class PEAR_Remote extends PEAR 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)) { @@ -99,4 +110,6 @@ class PEAR_Remote extends PEAR // }}} } +overload("PEAR_Remote"); + ?>
\ No newline at end of file |