debugConsole Documentation
/** * debugConsole demonstration * * This script demonstrates each feature of the debugConsole. The * debugConsole is a PHP5 class using JavaScripts to show debug * information in a popup window. The popup has IP-based access * control. Configurate everything in debugConsole.config.php. * Additionally, PHP's default errorhandler is replaced. * * @author Andreas Demmer <mail@andreas-demmer.de> * @version 1.0.1 * @package debugConsole_1.2.0 */
echo '<h1>debugConsole Demonstration</h1>';
/* PHP5 required */ if (version_compare(PHP_VERSION, '5.0.0') < 0) { die('The debugConsole requires PHP 5.x.x or greater.'); }
/* load debugConsole functionality */ require_once 'debugConsole.php';
/* Now you got an extended commandset:
dc_watch() watch variable changes in console dc_dump() var_dump variables in console dc_here() mark checkpoints in console dc_start_timer() measure a timespan dc_stop_timer() output timespan in console */
/* test watches */ dc_watch('foo');
declare (ticks = 1) { $foo = '1'; $foo++;
/* test checkpoints */ dc_here('The interpreter passed through here!'); /* test timer clock */ $myTimer = dc_start_timer('Measure an one second sleep:'); sleep(1); dc_stop_timer($myTimer);
/* test variable debugging */ $bar = 42.0; dc_dump($bar, '$bar tells us the meaning of life:'); $foobar = array ( 'foo' => $foo, 'bar' => $bar ); dc_dump($foobar, '$foobar is a neat array!');
/* test errorhandling */ echo $notSet; fopen('not existing!', 'r'); }
echo '<p>Testdrive completed!</p>';
|