Source for file PHP_Debug_HTML_Table_test.php
Documentation is available at PHP_Debug_HTML_Table_test.php
* Test script for PHP_Debug 2.0.0
* @since V2.0.0 - 6 apr 2006
* @version CVS: $Id: PHP_Debug_HTML_Table_test.php,v 1.5 2009/01/12 21:13:00 c0il Exp $
//session_start(); // Start session
$renderer = 'HTML_Table';
// Options array for Debug object
'render_mode' => 'Table',
'restrict_access' => false ,
'allow_url_access' => true ,
'replace_errorhandler' => true ,
'HTML_TABLE_view_source_script_name' => 'PHP_Debug_ShowSource.php',
'HTML_TABLE_css_path' => 'css'
require_once 'PHP/Debug.php';
echo '<?xml version="1.0" encoding="UTF-8"?>
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<title>Pear::PHP_Debug</title>
<link rel="stylesheet" type="text/css" media="screen" href="'. $options['HTML_TABLE_css_path'] . '/html_table.css" />
<a href="http://validator.w3.org/check?uri=referer"><img
src="http://www.w3.org/Icons/valid-xhtml10"
alt="Valid XHTML 1.0 Strict" height="31" width="88" /></a>
<a href="PHP_Debug_HTML_Div_test.php">» HTML_DIV Renderer</a><br/>
<a href="PHP_Debug_HTML_Table_test.php">» HTML_Table Renderer</a><br/>
<a href="PHP_Debug_test.php">» Test min</a><br/>
<a href="PHP_Debug_Sources.php">» Show sources</a><br/>
<a href="http://www.php-debug.com">» Back to PHP_Debug home</a><br/>
// Tests variables ============================================================
// One variable that will be watched by PHP_Debug
// One session variable to test the debugtype = PHP_DebuLine::TYPE_ENV (4)
$_SESSION['Kikoo'] = 'One session variable defined';
// Debug Object creation =======================================================
$Dbg = new PHP_Debug ($options);
// Test restrictAcess() function, only IP in param array will see the debug ====
$Dbg->restrictAccess ($allowedip);
// Test add() function =========================================================
$Dbg->add ("This is the <b>HTML_Table_Render</b>, client IP is ".
$_SERVER['REMOTE_ADDR']);
// Standard, fix end and start time manually
$debug_line = $Dbg->add ('Manual performance monitoring');
$debug_line->setStartTime ();
for ($i = 0; $i < 20000; $i++ ) {
$debug_line->setEndTime ();
// Test dump() function ========================================================
// dump a variable (integer)
// dump a variable (double)
$Dbg->dump ($foo2, 'Foo2');
//$Dbg->dump($options, 'Options');
$testObject = new PHP_DebugLine('info info info inside DebugLine object');
// dump an object and die the script
//PHP_Debug::dumpVar($testObject, 'stooooooop', true);
// Test setAction() ============================================================
// Type 12 : Page action : --> Methode publique a creer
$action = 'view_test_action';
$Dbg->setAction ($action);
// Test watch() function, watched var is 'watchedVariable' =====================
// /!\ Be carefull the tick directive does not work under windows /!\
// and make apache crash. To test under unix, remove comments bellow and
// corresponding brace line 170
//{ // <-- uncomment here
// Watch the variable called 'watchedVariable'
//$Dbg->watch('watchedVariable');
// Stress backtrace function (check line, file, function, class results) ===
global $Dbg, $watchedVariable;
$Dbg->addDebug ('call from a() fonction');
global $Dbg, $watchedVariable;
$Dbg->add ('call from b() fonction');
$Dbg->addDebugFirst ('call after b() and a() but adding in 1st');
$watchedVariable = 'converting from INT to STR';
//} // End of declare {ticks=n} block <-- uncomment here
// Test the add() function with the timer ======================================
$Dbg->add ('PERF TEST : 10000 iteration');
for ($index = 0; $index < 10000; $index++ ) {
// Test the query() function ===================================================
$Dbg->query ('SELECT * FROM PHP_DEBUG_USERS');
for ($index = 0; $index < 10000; $index++ ) {
// Test custom error handler ===================================================
echo $notset; // Will raise a PHP notice
fopen('not existing!', 'r'); // Will raise a PHP warning
trigger_error('This is a custom application error !!', E_USER_ERROR );
// Will raise a custom user error
$Dbg->error ('Bad status of var x in application PHP_Debug');
// Will add an application error
// Display Debug information (HTML_Table renderer) =============================
// Test __toString(), dumpVar() functions and structure of Debug object ========
// END =========================================================================
Documentation generated on Mon, 11 Mar 2019 15:28:40 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|