1
0
mirror of https://github.com/php/php-src.git synced 2026-04-19 14:01:01 +02:00

Fix a couple of warnings when calling PEAR::raiseError() statically.

This commit is contained in:
Chuck Hagenbuch
2001-03-29 19:54:27 +00:00
parent b8f18cbc3d
commit 183b651a84

View File

@@ -234,14 +234,18 @@ class PEAR
$options = null, $userinfo = null)
{
if ($mode === null) {
$mode = $this->_default_error_mode;
if (isset($this->_default_error_mode)) {
$mode = $this->_default_error_mode;
}
if ($mode === null) {
$mode = $GLOBALS['_PEAR_default_error_mode'];
}
}
if ($mode == PEAR_ERROR_TRIGGER && $options === null) {
$options = $this->_default_error_options;
if (isset($this->_default_error_options)) {
$options = $this->_default_error_options;
}
if ($options === null) {
$options = $GLOBALS['_PEAR_default_error_options'];
}
@@ -251,14 +255,20 @@ class PEAR
if (!is_string($options) &&
!(is_array($options) && sizeof($options) == 2 &&
is_object($options[0]) && is_string($options[1]))) {
$options = $this->_default_error_callback;
if (isset($this->_default_error_callback)) {
$options = $this->_default_error_callback;
}
if ($options === null) {
$options = $GLOBALS['_PEAR_default_error_callback'];
}
}
} else {
if ($options === null) {
$options = $this->_default_error_options;
if (isset($this->_default_error_options)) {
$options = $this->_default_error_options;
} else {
$options = $GLOBALS['_PEAR_default_error_options'];
}
}
}
return new PEAR_Error($message, $code, $mode, $options, $userinfo);