PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Internationalization » Translation2 » Bug #6574

Translation2_Container::raiseError does not honor global PEAR error settings

Details

Submitted2006-01-25 01:03 UTC
Fromjrossiter at pheedo dot com
Assignedquipo
StatusClosed
PackageTranslation2
PHP VersionIrrelevant
OSLinux
Roadmaps(Not assigned)

Comments

[2006-01-25 01:03 UTC] jrossiter at pheedo dot com

Description:
------------
Translation2 2.0.0b8

Translation2_Container::raiseError does not honor the global PEAR error settings (PEAR_ERROR_RETURN, etc.) because its function definition is as such:

function raiseError($msg, $code, $mode=PEAR_ERROR_TRIGGER, $option=E_USER_WARNING)

If no mode is specified it defaults to TRIGGER and is not overridable by the developer.

Expected result:
----------------
Class should store and honor the global PEAR preference either by properly extending the PEAR class so that setErrorHandling() can be used, or by using $GLOBALS['_PEAR_default_error_mode'] if it's set.

[2006-01-26 18:18 UTC] jrossiter at pheedo dot com

Actually, what might be the best, compatibility speaking, is to keep the definition the way it is, but add

if (isset($GLOBALS['_PEAR_default_error_mode'])) {
$mode = $GLOBALS['_PEAR_default_error_mode'];
}

at the top. That way it would work if users didn't have it set, and would continue to use the TRIGGER default, but would accept an override if present.