*/
function isError($data, $code = null)
{
- if (is_object($data) && (get_class($data) == 'pear_error' ||
- is_subclass_of($data, 'pear_error'))) {
+ if (is_object($data) && (strtolower(get_class($data)) == 'pear_error' ||
+ is_subclass_of($data, 'PEAR_Error'))) {
if (is_null($code)) {
return true;
} elseif (is_string($code)) {
function setErrorHandling($mode = null, $options = null)
{
if (isset($this) &&
- (get_class($this) == 'pear' || is_subclass_of($this, 'pear'))) {
+ (strtolower(get_class($this)) == 'pear' || is_subclass_of($this, 'PEAR'))) {
$setmode = &$this->_default_error_mode;
$setoptions = &$this->_default_error_options;
} else {
{
$stack = &$GLOBALS['_PEAR_error_handler_stack'];
if (isset($this) &&
- (get_class($this) == 'pear' || is_subclass_of($this, 'pear'))) {
+ (strtolower(get_class($this)) == 'pear' || is_subclass_of($this, 'PEAR'))) {
$def_mode = &$this->_default_error_mode;
$def_options = &$this->_default_error_options;
} else {
$stack[] = array($def_mode, $def_options);
if (isset($this) &&
- (get_class($this) == 'pear' || is_subclass_of($this, 'pear'))) {
+ (strtolower(get_class($this)) == 'pear' || is_subclass_of($this, 'PEAR'))) {
$this->setErrorHandling($mode, $options);
} else {
PEAR::setErrorHandling($mode, $options);
list($mode, $options) = $stack[sizeof($stack) - 1];
array_pop($stack);
if (isset($this) &&
- (get_class($this) == 'pear' || is_subclass_of($this, 'pear'))) {
+ (strtolower(get_class($this)) == 'pear' || is_subclass_of($this, 'PEAR'))) {
$this->setErrorHandling($mode, $options);
} else {
PEAR::setErrorHandling($mode, $options);