\Horde_Support_Backtrace

Wrapper around backtraces providing utility methods.

Copyright 1999-2017 Horde LLC (http://www.horde.org/)

Summary

Methods
Properties
Constants
__construct()
createFromDebugBacktrace()
createFromThrowable()
createFromException()
getNestingLevel()
getContext()
getCurrentContext()
getCallingContext()
__toString()
$backtrace
No constants found
_createFromThrowable()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$backtrace

$backtrace : array

Backtrace.

Type

array

Methods

__construct()

__construct(\Exception|array  $backtrace = null) 

Constructor.

Parameters

\Exception|array $backtrace

The backtrace source. Either a trowable, an exception or an existing backtrace. Defaults to the current stack.

createFromDebugBacktrace()

createFromDebugBacktrace(array  $backtrace, integer  $nestingLevel) 

Wraps the result of debug_backtrace().

By specifying a non-zero $nestingLevel, levels of the backtrace can be ignored. For instance, when Horde_Support_Backtrace creates a backtrace for you, it ignores the Horde_Backtrace constructor in the wrapped trace.

Parameters

array $backtrace

The debug_backtrace() result.

integer $nestingLevel

The number of levels of the backtrace to ignore.

createFromThrowable()

createFromThrowable(\Throwable  $e) 

Wraps an error object's backtrace.

Parameters

\Throwable $e

The error to wrap.

createFromException()

createFromException(\Exception  $e) 

Wraps an Exception object's backtrace.

Parameters

\Exception $e

The exception to wrap.

getNestingLevel()

getNestingLevel() : integer

Returns the nesting level (number of calls deep) of the current context.

Returns

integer —

Nesting level.

getContext()

getContext(integer  $nestingLevel) : array

Returns the context at a specific nesting level.

Parameters

integer $nestingLevel

0 == current level, 1 == caller, and so on

Returns

array —

The requested context.

getCurrentContext()

getCurrentContext() : array

Returns details about the routine where the exception occurred.

Returns

array —

$caller

getCallingContext()

getCallingContext() : array

Returns details about the caller of the routine where the exception occurred.

Returns

array —

$caller

__toString()

__toString() : string

Returns a simple, human-readable list of the complete backtrace.

Returns

string —

The backtrace map.

_createFromThrowable()

_createFromThrowable(\Throwable  $e) 

Wraps an error object's backtrace.

Parameters

\Throwable $e

The error to wrap.