mpDebugDebug class. Provides a possibility to debug variables without destroying the page output.
If debugging is enabled, the output will be a small collapsable mpWebDebug bar at the top left corner of the page.
Inspired by the Web Debug Toolbar of symfony Framework whith a simple way to provide debug informations during development.
See example1.php and example2.php in delivered package.
Usage:
Located in /contenido/classes/mp/class.mpdebug.php (line 63)
| Class | Description |
|---|---|
Contenido_mpDebug
|
Contenido debug class, extends mpDebug and adds logging feature by using a wrapper for |
int
$_counter
= 0 (line 105)
Counter 4 added debug items
string
$_docRoot
(line 99)
Document root
array
$_dumpCache
= array() (line 81)
Array to store dumps of variables, as follows:
array
$_dumpSuperglobals
= array('$_GET', '$_POST', '$_COOKIE', '$_SESSION') (line 117)
List of superglobals names to dump automatically.
bool
$_enable
= false (line 87)
Flag to activate debug
bool
$_ignoreEmptySuperglobals
= false (line 123)
Ignore dumping of empty superglobals.
array
$_resUrls
= array() (line 111)
Debug links absolute from document-root, e. g. to log files or other docs.
bool
$_trimDocRoot
= true (line 93)
Flag to trim document root from paths
Returns a instance of mpDebug (singleton implementation)
Adds a varible dump, does the same as addVdump().
Adds a varible dump.
Decorates given data with a html comment and returns it back or prints it out.
Returns the code (CSS-/ and JavaScript part) for the mpDebugBar, which can be placed inside the head-Tag.
Prevents multiple delivering of the code using a static variable. Only the first call will return the code.
Main method to get the mpWebDebug Bar.
Returns or prints the mpWebDebug Bar depending on state of $print
Sets configuration
Wrapper 4 var_dump function. Dumps content of passed variable.
Adds passed variable to the debug cache.
Prints the content of passed debug item, depending on its type (array, object, string)
Dumps passed variable.
Creates list of linked ressource files. The result will be added to mpWebDebug.
Returns the Superglobal variable by name. Provides a precheck of superglobal size to prevend debugging variables having several MB. e. g. $_POST.
Does not support the return of $GLOBALS. This variable contains since PHP 5 several cross references, therefore a dump will result in crossing memory limit or script timeout.
Creates a unique id used as id-Attribute for HTML elements using timer and internal counter.
Prepares data dump for output. Clears some white space characters and line endings to get an compact an more readable result.
Returns approximate size of superglobal in kb if size is > 512 kb or false
Documentation generated on Wed, 24 Dec 2008 21:44:11 +0100 by phpDocumentor 1.4.1