cvs: php4 /pear/PEAR Remote.php

From: Date: Wed, 02 Jan 2002 17:09:59 +0000
Subject: cvs: php4 /pear/PEAR Remote.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-1791@lists.php.net to get a copy of this message
ssb Wed Jan 2 12:09:59 2002 EDT Modified files: /php4/pear/PEAR Remote.php Log: * use new overloading API properly Index: php4/pear/PEAR/Remote.php diff -u php4/pear/PEAR/Remote.php:1.7 php4/pear/PEAR/Remote.php:1.8 --- php4/pear/PEAR/Remote.php:1.7 Tue Dec 11 19:10:47 2001 +++ php4/pear/PEAR/Remote.php Wed Jan 2 12:09:59 2002 @@ -17,7 +17,7 @@ // | | // +----------------------------------------------------------------------+ // -// $Id: Remote.php,v 1.7 2001/12/12 00:10:47 ssb Exp $ +// $Id: Remote.php,v 1.8 2002/01/02 17:09:59 ssb Exp $ require_once 'PEAR.php'; @@ -49,28 +49,32 @@ { $args = func_get_args(); array_shift($args); - return $this->__call($method, $args); + $this->__call($method, $args, $retval); + return $retval; } // }}} // {{{ __call(method, args) - function __call($method, $params) + function __call($method, $params, &$retval) { if (!extension_loaded("xmlrpc")) { - return $this->raiseError("xmlrpc support not loaded"); + $retval = $this->raiseError("xmlrpc support not loaded"); + return false; } $method = str_replace("_", ".", $method); $request = xmlrpc_encode_request($method, $params); $server_host = $this->config_object->get("master_server"); if (empty($server_host)) { - return $this->raiseError("PEAR_Remote::call: no master_server configured"); + $retval = $this->raiseError("PEAR_Remote::call: no master_server configured"); + return false; } $server_port = 80; $fp = @fsockopen($server_host, $server_port); if (!$fp) { - return $this->raiseError("PEAR_Remote::call: fsockopen(`$server_host', $server_port) failed"); + $retval = $this->raiseError("PEAR_Remote::call: fsockopen(`$server_host', $server_port) failed"); + return false; } $len = strlen($request); fwrite($fp, ("POST /xmlrpc.php HTTP/1.0\r\n". @@ -96,15 +100,18 @@ if ($ret['message'] === '') $ret['message'] = null; if ($ret['userinfo'] === '') $ret['userinfo'] = null; if (strtolower($class) == 'db_error') { - return $this->raiseError(DB::errorMessage($ret['code']), - $ret['code'], null, null, - $ret['userinfo']); + $retval = $this->raiseError(DB::errorMessage($ret['code']), + $ret['code'], null, null, + $ret['userinfo']); } else { - return $this->raiseError($ret['message'], $ret['code'], - null, null, $ret['userinfo']); + $retval = $this->raiseError($ret['message'], $ret['code'], + null, null, $ret['userinfo']); } + return true; } } + $retval = $ret; + return true; } // }}}

« previous php.pear.cvs (#1791) next »