private function _trace($strMessage)
    {
        $arrTrace = array_reverse(debug_backtrace());
        $strFunc = '';
        $strBacktrace = htmlspecialchars($strMessage)."\n\n";
        foreach ($arrTrace as $val) {
            // avoid the last line, which says the error is from the error class
            if ($val == $arrTrace[count($arrTrace) - 1]) {
                break;
            }
            $strBacktrace .= str_replace(PSI_APP_ROOT, ".", $val['file']).' on line '.$val['line'];
            if ($strFunc) {
                $strBacktrace .= ' in function '.$strFunc;
            }
            if ($val['function'] == 'include' || $val['function'] == 'require' || $val['function'] == 'include_once' || $val['function'] == 'require_once') {
                $strFunc = '';
            } else {
                $strFunc = $val['function'].'(';
                if (isset($val['args'][0])) {
                    $strFunc .= ' ';
                    $strComma = '';
                    foreach ($val['args'] as $valArgs) {
                        $strFunc .= $strComma.$this->_printVar($valArgs);
                        $strComma = ', ';
                    }
                    $strFunc .= ' ';
                }
                $strFunc .= ')';
            }
            $strBacktrace .= "\n";
        }

        return $strBacktrace;
    }
private function _trace($strMessage)
    {
        $arrTrace = array_reverse(debug_backtrace());
        $strFunc = '';
        $strBacktrace = htmlspecialchars($strMessage)."\n\n";
        foreach ($arrTrace as $val) {
            // avoid the last line, which says the error is from the error class
            if ($val == $arrTrace[count($arrTrace) - 1]) {
                break;
            }
            $strBacktrace .= str_replace(PSI_APP_ROOT, ".", $val['file']).' on line '.$val['line'];
            if ($strFunc) {
                $strBacktrace .= ' in function '.$strFunc;
            }
            if ($val['function'] == 'include' || $val['function'] == 'require' || $val['function'] == 'include_once' || $val['function'] == 'require_once') {
                $strFunc = '';
            } else {
                $strFunc = $val['function'].'(';
                if (isset($val['args'][0])) {
                    $strFunc .= ' ';
                    $strComma = '';
                    foreach ($val['args'] as $valArgs) {
                        $strFunc .= $strComma.$this->_printVar($valArgs);
                        $strComma = ', ';
                    }
                    $strFunc .= ' ';
                }
                $strFunc .= ')';
            }
            $strBacktrace .= "\n";
        }

        return $strBacktrace;
    }
private function _trace ( $ strMessage ) { $ arrTrace = array_reverse ( debug_backtrace ( ) ) ; $ strFunc = '' ; $ strBacktrace = htmlspecialchars ( $ strMessage ) . "\n\n" ; foreach ( $ arrTrace as $ val ) { // avoid the last line, which says the error is from the error class if ( $ val == $ arrTrace [ count ( $ arrTrace ) - 1 ] ) { break ; } $ strBacktrace .= str_replace ( PSI_APP_ROOT , "." , $ val [ 'file' ] ) . ' on line ' . $ val [ 'line' ] ; if ( $ strFunc ) { $ strBacktrace .= ' in function ' . $ strFunc ; } if ( $ val [ 'function' ] == 'include' || $ val [ 'function' ] == 'require' || $ val [ 'function' ] == 'include_once' || $ val [ 'function' ] == 'require_once' ) { $ strFunc = '' ; } else { $ strFunc = $ val [ 'function' ] . '(' ; if ( isset ( $ val [ 'args' ] [ 0 ] ) ) { $ strFunc .= ' ' ; $ strComma = '' ; foreach ( $ val [ 'args' ] as $ valArgs ) { $ strFunc .= $ strComma . $ this -> _printVar ( $ valArgs ) ; $ strComma = ', ' ; } $ strFunc .= ' ' ; } $ strFunc .= ')' ; } $ strBacktrace .= "\n" ; } return $ strBacktrace ; }
generate a function backtrace for error diagnostic, function is genearally based on code submitted in the php reference page

@param string $strMessage additional message to display

@return string formatted string of the backtrace
generate a function backtrace for error diagnostic function is genearally based on code submitted in the php reference page