function staticGetErrors($purge = false, $level = false, $merge = false,
                             $sortfunc = array('PEAR_ErrorStack', '_sortErrors'))
    {
        $ret = array();
        if (!is_callable($sortfunc)) {
            $sortfunc = array('PEAR_ErrorStack', '_sortErrors');
        }
        foreach ($GLOBALS['_PEAR_ERRORSTACK_SINGLETON'] as $package => $obj) {
            $test = $GLOBALS['_PEAR_ERRORSTACK_SINGLETON'][$package]->getErrors($purge, $level);
            if ($test) {
                if ($merge) {
                    $ret = array_merge($ret, $test);
                } else {
                    $ret[$package] = $test;
                }
            }
        }
        if ($merge) {
            usort($ret, $sortfunc);
        }
        return $ret;
    }
function staticGetErrors($purge = false, $level = false, $merge = false,
                             $sortfunc = array('PEAR_ErrorStack', '_sortErrors'))
    {
        $ret = array();
        if (!is_callable($sortfunc)) {
            $sortfunc = array('PEAR_ErrorStack', '_sortErrors');
        }
        foreach ($GLOBALS['_PEAR_ERRORSTACK_SINGLETON'] as $package => $obj) {
            $test = $GLOBALS['_PEAR_ERRORSTACK_SINGLETON'][$package]->getErrors($purge, $level);
            if ($test) {
                if ($merge) {
                    $ret = array_merge($ret, $test);
                } else {
                    $ret[$package] = $test;
                }
            }
        }
        if ($merge) {
            usort($ret, $sortfunc);
        }
        return $ret;
    }
function staticGetErrors ( $ purge = false , $ level = false , $ merge = false , $ sortfunc = array ( 'PEAR_ErrorStack' , '_sortErrors' ) ) { $ ret = array ( ) ; if ( ! is_callable ( $ sortfunc ) ) { $ sortfunc = array ( 'PEAR_ErrorStack' , '_sortErrors' ) ; } foreach ( $ GLOBALS [ '_PEAR_ERRORSTACK_SINGLETON' ] as $ package => $ obj ) { $ test = $ GLOBALS [ '_PEAR_ERRORSTACK_SINGLETON' ] [ $ package ] -> getErrors ( $ purge , $ level ) ; if ( $ test ) { if ( $ merge ) { $ ret = array_merge ( $ ret , $ test ) ; } else { $ ret [ $ package ] = $ test ; } } } if ( $ merge ) { usort ( $ ret , $ sortfunc ) ; } return $ ret ; }
Get a list of all errors since last purge, organized by package
@since PEAR 1.4.0dev BC break! $level is now in the place $merge used to be
@param boolean $purge Set to purge the error stack of existing errors
@param string  $level Set to a level name in order to retrieve only errors of a particular level
@param boolean $merge Set to return a flat array, not organized by package
@param array   $sortfunc Function used to sort a merged array - default
sorts by time, and should be good for most cases
@static
@return array
Get a list of all errors since last purge organized by package