Returns a instance of mpDebug (singleton implementation)
Redefined in descendants as:
Constructor
mpDebug
__construct
()
Adds a varible dump, does the same as addVdump().
void
addDebug
(mixed $var, string $name, [string $source = null], [string $line = null])
-
mixed
$var: Variable 2 dump
-
string
$name: Additional info like name or whatever you wan't do describe the passed variable
-
string
$source: Filename (e. g. __FILE__) to specify the location of caller
-
string
$line: Line (e. g. __LINE__) to specifiy the line number
Adds a varible dump.
void
addVdump
(mixed $var, string $name, [string $source = null], [string $line = null])
-
mixed
$var: Variable 2 dump
-
string
$name: Additional info like name or whatever you wan't do describe the passed variable
-
string
$source: Filename (e. g. __FILE__) to specify the location of caller
-
string
$line: Line (e. g. __LINE__) to specifiy the line number
Decorates given data with a html comment and returns it back or prints it out.
mixed
comment
(string $content, [bool $print = true])
-
string
$content: Data to decorate with comment
-
bool
$print: Flag to print the result
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.
string
getCssJsCode
()
Main method to get the mpWebDebug Bar.
Returns or prints the mpWebDebug Bar depending on state of $print
mixed
getResults
([bool $print = true])
-
bool
$print: Flag to print the mpWebDebug Bar
Sets configuration
void
setConfig
( $options)
-
array
$options: Options array as follows:
// true or false to enable/disable debugging
$options['enable'] = true;
// Array of ressource files which will be linked at the end of debug output. You can add e. g.
// the HTML path to existing logfiles.
$options['ressource_urls'] = array('/contenido/logs/errorlog.txt', '/cms/logs/my_own_log.txt');
// Array superglobals to dump automatically, add each superglobal, but not $GLOBALS
$options['dump_super_globals'] = array('$_GET', '$_POST', '$_COOKIE', '$_SESSION');
// Flag to ignore dumpoutput of empty superglobals
$options['ignore_empty_superglobals'] = true;
// Magic word to use, if you want to overwrite $options['enable'] option. You can force debugging
// by using this option. In this case, you can enable it adding the parameter
// magic_word={my_magic_word} to the URL, e. g.
// http://domain.tld/mypage.php?magic_word={my_magic_word}
// After then debugging will be enabled for the next 1 hour (set by cookie)
$options['magic_word'] = 'foobar';
// Second way to overwrite option $options['enable']. Here you can define a own function, which
// should check, if debugging is to enable or not. The function should return a boolean value,
// true to enable it, or false to disable.
$options['user_func'] = 'myFunctionName';
Wrapper 4 var_dump function. Dumps content of passed variable.
mixed
vdump
(mixed $var, [string $source = ''], [bool $print = true], [bool $decorate = false])
-
mixed
$var: Variable 2 dump content
-
string
$source: Name of source
-
bool
$print: Flag to print out dump result
-
bool
$decorate: Flag to decorate the dump result with pre-Tag
Adds passed variable to the debug cache.
void
_addDebugValue
(mixed $var, string $name, string $source, string $line)
-
mixed
$var: Variable 2 dump
-
string
$name: Additional info like name or whatever you wan't do describe the passed variable
-
string
$source: Filename (e. g. __FILE__) to specify the location of caller
-
string
$line: Line (e. g. __LINE__) to specifiy the line number
Prints the content of passed debug item, depending on its type (array, object, string)
string
_contentOutput
(string $name, mixed $var, [string $info = null])
-
string
$name: Name of the variable
-
mixed
$var: The variable itself
-
string
$info: Info about the variable
Dumps passed variable.
string
_dumpVar
( &$var, mixed $var)
-
mixed
$var: Variable to dump content
-
&$var
Returns the footer of mpWebDebug
string
_endOutput
()
Creates list of linked ressource files. The result will be added to mpWebDebug.
string
_getRessourceLinks
()
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.
mixed
_getSuperGlobal
(string $name)
-
string
$name: Name of superglobal
Creates a unique id used as id-Attribute for HTML elements using timer and internal counter.
string
_nextId
()
Prepares data dump for output. Clears some white space characters and line endings to get an compact an more readable result.
void
_prepareDumpOutput
( &$dumpOutput, string $dumpOutput)
-
string
$dumpOutput: Output of var_dump()
-
&$dumpOutput
Returns the mpWebDebug bar header.
string
_startOutput
()
Returns approximate size of superglobal in kb if size is > 512 kb or false
mixed
_superGlobalTooBig
( &$sglobal, mixed $sglobal)