Class webdebugger

Description

The debugger class. Responsible for accumulating, filtering and then

rendering debug content to various outputs. This class is automatically instantiated by the system as $RESPONSE->debugger; and is used by various modules (eg. query) to log information. It can also be used as either an ad-hoc debugging aid, or as an analysis tool where debug output statements are inserted into code and left there permanently, their output only switched on when problems arise. Various classes of debug output can be enabled in any combination by OR'ing the following constants when the debug_on() function is called: DBG_DEBUG Ad-hoc debugging output DBG_DIAGNOSTIC Diagnostic output DBG_SQL SQL queries to database DBG_SQLDATA SQL SELECT data from database DBG_DUMP Dump HTTP and PHP page vars DBG_TRACE Provide debug traceback info DBG_TABLES Show table borders and validate cells DBG_DEFAULT DEBUG and DIAGNOSTICS only DBG_ALL Everything (verbose!) eg. debug_on(DBG_SQL | DBG_DIAGNOSTIC | DBG_DUMP);

Located in /debugger.php (line 97)

RenderableObject
   |
   --webdebugger
Variable Summary
 mixed $class
 mixed $content
 mixed $enabled
 mixed $output_mode
 mixed $profile
 mixed $trace
 mixed $tracedepth
Method Summary
 webdebugger webdebugger ([integer $class = DBG_DEFAULT])
 void debug_class (integer $class)
 void debug_mode ([boolean $enabled = true], [integer $class = DBG_UNDEFINED])
 void debug_output ([integer $mode = DBG_O_DEFAULT])
 void debug_write (string $content, [integer $class = DBG_DIAGNOSTIC])
 string html ()
 void profile (string $label)
 void profiling ()
 string report_classes ()
 void send_to_file (string $name, [string $dir = ""])
 string traceback ()
 string wml ()
Variables
mixed $class = DBG_DEFAULT (line 102)

Classes of debugging to accumulate

mixed $content = "" (line 100)

Accumulated debugging output content

mixed $enabled = false (line 104)

Status of the debugger

mixed $output_mode = DBG_O_DEFAULT (line 106)

Modes of output for debugging content

mixed $profile = array() (line 120)

Profiler data array

mixed $profile_timer (line 117)

Microtimer object for profiling

mixed $trace = array() (line 111)

Array of traced locations

mixed $tracedepth = 0 (line 114)

Depth of tracing

Methods
Constructor webdebugger (line 127)

Constructor

webdebugger webdebugger ([integer $class = DBG_DEFAULT])
  • integer $class: The classes of output to render
debug_class (line 204)

Set debug class(es) to accept

void debug_class (integer $class)
  • integer $class: Class of output
debug_hascontent (line 134)

Return whether we have any content, true or false.

void debug_hascontent ()
debug_mode (line 219)

Set debug mode

Set debug output to be enabled(default)/disabled

void debug_mode ([boolean $enabled = true], [integer $class = DBG_UNDEFINED])
  • boolean $enabled: If true enable debugger, else disable it
  • integer $class: Class of output to accept
debug_output (line 161)

Set debug output mode

This function starts/stops the debugger from echoing the content directly as well as storing it for a subsequent display by webpage-defs.php. The values which can be OR'ed together are as follows: DBG_O_NONE No output DBG_O_STORED Output stored in $content DBG_O_ECHO Output via direct echo DBG_O_CLI Output for CLI: echoed raw ASCII, LF end-of-line DBG_O_LOG Output to system log DBG_O_LOGFILE To logfile (not implemented yet) DBG_O_DEFAULT Default output mode (echoed) DBG_O_ALL Ubiquitous output mode

void debug_output ([integer $mode = DBG_O_DEFAULT])
  • integer $mode: Output mode of debugger
debug_write (line 172)

Set debug output mode Register content for debugging output. Check that it is of an acceptable class and direct it all to the right place(s).

void debug_write (string $content, [integer $class = DBG_DIAGNOSTIC])
  • string $content: Content to add to debug output buffer
  • integer $class: Class of output
html (line 393)

Use render() to render the debugger output.

Renders the debugger output content as HTML.

string html ()

Redefinition of:
RenderableObject::html()
Return output suitable for normal HTML-capable device. This method must be over-ridden by a method of the same name in the descendant class which renders output to web browsers.
profile (line 244)

Profile breakpoint.

Profiling allows you to ascertain the elapsed time between two breakpoints. To do this just call this method twice with the same label.

void profile (string $label)
  • string $label: A label for this profile breakpoint
profiling (line 293)

Returns true if this debugger is in profiling mode.

void profiling ()
report_classes (line 301)

List classes debugger is accepting

  • return: List of classes acceptable to the debugger
string report_classes ()
send_to_file (line 580)

Send debug output to a file.

void send_to_file (string $name, [string $dir = ""])
  • string $name: Filename to put output into
  • string $dir: Directory/path to put file into
traceback (line 372)

Traceback list Return a string of the form "label->label->label" forming the traceback level labels in order.

  • return: Traceback list
string traceback ()
wml (line 525)

Use render() to render the debugger output.

Renders the debugger output content as WML.

string wml ()

Redefinition of:
RenderableObject::wml()
Return output suitable for normal wap-capable device. This method must be over-ridden by a method of the same name in the descendant class which renders output to wap devices.

Inherited Methods

Inherited From RenderableObject

 RenderableObject::RenderableObject()
 RenderableObject::html()
 RenderableObject::render()
 RenderableObject::wml()
 RenderableObject::wmlup()
 RenderableObject::xml()

Documentation generated by phpDocumentor 1.3.0RC3