Current File : //opt/RZphp83/includes/docs/PHP_Debug/docs/FAQ |
+-----------------------------------------------------------------------------+
+-- PHP_Debug : A simple and fast way to debug your PHP code |
+-- |
+-- Support : Vernet Loic (coil[at]php-debug[dot]com) |
+-----------------------------------------------------------------------------+
== FAQ ========================================================================
== What are the different debug type ?
- TYPE_ANY : All available types (for search mode)
- TYPE_STD : Standart debug
- TYPE_QUERY : Query debug
- TYPE_REL : Database related debug
- TYPE_ENV : Environment debug ($GLOBALS...)
- TYPE_APPERROR : Custom application error
- TYPE_CREDITS : Credits information
- TYPE_SEARCH : Search mode in debug
- TYPE_DUMP : Dump any kind of variable
- TYPE_PROCESSPERF : Performance analysys
- TYPE_TEMPLATES : Included templates of the calling script
- TYPE_PAGEACTION : Store main page action
- TYPE_SQLPARSE : SQL Parse error
- TYPE_WATCH : A variable to watch
- TYPE_PHPERROR : A debug generated by the custom error handler
But in fact, these types are automatically used with the different public
functions of PHP_Debug.
== What are the different general options available ?
<?php
$options = array(
'restrict_access' => false,
'allow_url_access' => true,
'url_key' => 'key',
'url_pass' => 'nounou',
'enable_watch' => false,
'replace_errorhandler' => true,
);
$Dbg = new PHP_Debug($options);
$allowedip = array(
'127.0.0.1'
);
$Dbg->restrictAcess($allowedip);
?>
- restrict_access
Allow to restrict access to some IP only.
This is done by calling the restrict access function, with an array containing IP.
- allow_url_access
Allow to activate the display of the debug with a key and a password in
the URL of the executed script. (url_key, url_pass)
Ex : 'http://host/scripts.php?key=nounou'
- enable_watch
Allow to use the variable watcher (see index.php)
- replace_errorhandler
Allow to use the PHP_Debug error handler instead of the native PHP error
handler. In some cas (old PHP4 script) you may have lots of errors, it is
possible to desactivate it
== What are the different renderer options available ?
You can find all default options of each renderer in the HTML_xxx_Config.php
files.
== I don't understand the way stopTimer() function works can you explain me ?
Well in fact it is easy : (check index.php)
First you may add a debug info, of any tipe, then you simply have to call
the stopTimer function.
<?php
$Dbg->add('PERF TEST : 10000 iterations');
$y = 0;
for ($index = 0; $index < 10000; $index++)
{
$y = $y + $index;
}
$Dbg->stopTimer();
?>
== What are the different public functions available ?
Please check 'sources/index.php', there is an example with all the public
functions available in PHP_Debug.
Please........
Ahhhhhhh !!!!!!
- new PHP_Debug($array()) : PHP_Debug constructor
- restrictAcess($array) : Restrict debug to some IP
- add($mixed, $title (optional)) : Add the variable 'mixed' with the title 'string'
- dump(var, 'Foo', $stopprocess) : Dump the content of the variable 'var' with the title 'foo'
- dumpVar(var, 'Foo', $stopprocess) : Same as dump but can be called staticaly
- setAction($action) : Set the action of the scrip with $action (string)
- watch('watchedVariable') : Watch the variable called 'watchedVariable
- stopTimer() : Stop the timer for the last debug information added
- addDebugFirst($string) : Same as Add() but add the information in 1st position
- query($query) : Add a query wich sql script is contained in $query
- getRequiredFiles() : Return the list of required files in the script
- display() : Display the debug informations gathered until this call
- queryRel($query) : Add a debug info related to the database
- getOutput() : Get the display as a string
- getDebugInfos() : Get the debug infos as an array
- addSetting(), addSettings(), add debugs of "settings" type
== The debug is ugly it seems that there are no stylesheet associated with it ?
You can modify/extend the HTML_xxx_Config files and/or the related css files that
are used by PHP_Debug (check css dir)