Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

(no description)

File Size: 175 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Horde_Support_Backtrace:: (10 methods):
  __construct()
  createFromDebugBacktrace()
  createFromThrowable()
  _createFromThrowable()
  createFromException()
  getNestingLevel()
  getContext()
  getCurrentContext()
  getCallingContext()
  __toString()


Class: Horde_Support_Backtrace  - X-Ref

Wrapper around backtraces providing utility methods.

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

__construct($backtrace = null)   X-Ref
Constructor.

param: Exception|array $backtrace  The backtrace source. Either a

createFromDebugBacktrace($backtrace, $nestingLevel = 0)   X-Ref
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.

param: array $backtrace       The debug_backtrace() result.
param: integer $nestingLevel  The number of levels of the backtrace to

createFromThrowable(Throwable $e)   X-Ref
Wraps an error object's backtrace.

param: Throwable $e  The error to wrap.

_createFromThrowable($e)   X-Ref
Wraps an error object's backtrace.

param: Throwable $e  The error to wrap.

createFromException(Exception $e)   X-Ref
Wraps an Exception object's backtrace.

param: Exception $e  The exception to wrap.

getNestingLevel()   X-Ref
Returns the nesting level (number of calls deep) of the current context.

return: integer  Nesting level.

getContext($nestingLevel)   X-Ref
Returns the context at a specific nesting level.

param: integer $nestingLevel  0 == current level, 1 == caller, and so on
return: array  The requested context.

getCurrentContext()   X-Ref
Returns details about the routine where the exception occurred.

return: array $caller

getCallingContext()   X-Ref
Returns details about the caller of the routine where the exception
occurred.

return: array $caller

__toString()   X-Ref
Returns a simple, human-readable list of the complete backtrace.

return: string  The backtrace map.