diff options
author | Greg Beaver <cellog@php.net> | 2005-08-22 22:04:58 +0000 |
---|---|---|
committer | Greg Beaver <cellog@php.net> | 2005-08-22 22:04:58 +0000 |
commit | 2e3affd12110d2c438a70c70da892d6acc2713cf (patch) | |
tree | 427462d2307cd8b5f533899728080b40b8211416 | |
parent | c64fd50c99685fc09575650d9f0a1968253efc3f (diff) | |
download | php-git-2e3affd12110d2c438a70c70da892d6acc2713cf.tar.gz |
sync with PEAR 1.3.6
-rw-r--r-- | pear/PEAR.php | 14 | ||||
-rw-r--r-- | pear/PEAR/ErrorStack.php | 13 | ||||
-rw-r--r-- | pear/PEAR/Remote.php | 4 |
3 files changed, 19 insertions, 12 deletions
diff --git a/pear/PEAR.php b/pear/PEAR.php index fa89ea56d4..b3b8633e13 100644 --- a/pear/PEAR.php +++ b/pear/PEAR.php @@ -492,7 +492,7 @@ class PEAR * @see PEAR::setErrorHandling * @since PHP 4.0.5 */ - function raiseError($message = null, + function &raiseError($message = null, $code = null, $mode = null, $options = null, @@ -537,9 +537,11 @@ class PEAR $ec = 'PEAR_Error'; } if ($skipmsg) { - return new $ec($code, $mode, $options, $userinfo); + $a = &new $ec($code, $mode, $options, $userinfo); + return $a; } else { - return new $ec($message, $code, $mode, $options, $userinfo); + $a = &new $ec($message, $code, $mode, $options, $userinfo); + return $a; } } @@ -558,9 +560,11 @@ class PEAR $userinfo = null) { if (isset($this) && is_a($this, 'PEAR')) { - return $this->raiseError($message, $code, null, null, $userinfo); + $a = &$this->raiseError($message, $code, null, null, $userinfo); + return $a; } else { - return PEAR::raiseError($message, $code, null, null, $userinfo); + $a = &PEAR::raiseError($message, $code, null, null, $userinfo); + return $a; } } diff --git a/pear/PEAR/ErrorStack.php b/pear/PEAR/ErrorStack.php index d1dcf9233e..9ad94d738c 100644 --- a/pear/PEAR/ErrorStack.php +++ b/pear/PEAR/ErrorStack.php @@ -538,6 +538,10 @@ class PEAR_ErrorStack { 'message' => $msg, ); + if ($repackage) { + $err['repackage'] = $repackage; + } + // set up the error message, if necessary if ($this->_msgCallback) { $msg = call_user_func_array($this->_msgCallback, @@ -545,9 +549,6 @@ class PEAR_ErrorStack { $err['message'] = $msg; } - if ($repackage) { - $err['repackage'] = $repackage; - } $push = $log = true; $die = false; // try the overriding callback first @@ -909,8 +910,10 @@ class PEAR_ErrorStack { } else { $mainmsg = $stack->getErrorMessageTemplate($err['code']); } + $mainmsg = str_replace('%__msg%', $err['message'], $mainmsg); - if (count($err['params'])) { + + if (count($err['params']) && count($err['params'])) { foreach ($err['params'] as $name => $val) { if (is_array($val)) { // @ is needed in case $val is a multi-dimensional array @@ -978,4 +981,4 @@ class PEAR_ErrorStack { } $stack = &PEAR_ErrorStack::singleton('PEAR_ErrorStack'); $stack->pushCallback(array('PEAR_ErrorStack', '_handleError')); -?>
\ No newline at end of file +?> diff --git a/pear/PEAR/Remote.php b/pear/PEAR/Remote.php index c75b11b5c1..555ec63b6c 100644 --- a/pear/PEAR/Remote.php +++ b/pear/PEAR/Remote.php @@ -115,10 +115,10 @@ class PEAR_Remote extends PEAR $this->saveCache($_args, $result); }; return $result; - } - if (!@include_once("XML/RPC.php")) { + } elseif (!@include_once("XML/RPC.php")) { return $this->raiseError("For this remote PEAR operation you need to install the XML_RPC package"); } + array_shift($args); $server_host = $this->config->get('master_server'); $username = $this->config->get('username'); |