a php debugger Logo

1) Installation

Download the latest release and unzip it in your PHP directory. This can be your include directory (recommended).

2) Quick start

Include/require opendebug.php within your main PHP file.
Make a new instance of openDebug.
Set access for IP addresses other than the local host, or disable the access filter (not recommended).
Output the HTML with the getOutput() function, right after your last HTML code but before the </body> tag.
// include opendebug
// make new object
$debug = new openDebug();
// add IP address
// $debug->setFilter(false);

/* your own PHP/HTML code comes here */
// output
echo $debug->getOutput();
Browse your webpage you want to debug, and press tilde (~) on your keyboard. A screen will appear with information you can use to debug your flow.

3) Advanced functions

The default database is MySQL. To setup openDebug for Postgres, simply add the following code:
To write custom messages in the message log, use the function writeLog(String type,String message) where type is notice or warning.
$debug->writeLog("notice","this is a notice");
You can enable source viewing with the function setShowSource(Bool). Default is false. It is recommended to enable source viewing only when the access filter has been set.
4) Querying and caching results

openDebug can query a database for you and automatically cache the results so you can browse it. It is useful to know exactly which rows were returned by your query.
$resource = $debug->query("SELECT foo FROM bar",__LINE__);
First parameter is the actual query, second parameter is always __LINE__. This is required for openDebug to know which line the query was called.
The query function returns a resource identifier just like a normal query would do, with the exception that it caches any SELECT results.
You can browse the results in the Query result window.
Valid XHTML 1.0!