Class: Debugger

This is the debugging handler. It converts errors into ErrorException exceptions, and handles exceptions by printing a trace including highlighted source code.



if (conf ('General', 'debug')) {
    require_once ('lib/Debugger.php');
    Debugger::start ();



public static $is_error = false

This is set to true if an error is converted into an exception in Debugger::handle_error().


public static start ($on = true)

Set the error and exception handlers.

public static handle_exception ($e)

Handles exceptions.

public static log_exception ($e)

Handles exceptions by logging them.

public static show_trace ($trace)

Shows the trace output.

public static handle_error ($errno, $errstr, $errfile, $errline)

Converts errors to ErrorException exceptions.

public static show_trace_step ($trace)

Shows a step in the trace.

public static join_arguments ($args)

Joins arguments for displaying the relevant code in a trace step.

public static get_code ($file, $line)

Get the code for a step in the trace.

public static highlight ($line)

Highlight code for a trace step.

public static show_context ($context)

Show the context of a trace step.

public static show_variable ($value, $tabs = 0)

Show a variable for the debug output.

public static is_assoc ($array)

Checks if an array is associative.