WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
PHP Web Logs (BLogs)
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Submit Site
Forex Trading Online forex trading platform

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Buggy is a PHP class that allows to store relevant informations while running a PHP script so it can be analysed to find bugs, or any problem in code execution.
Categories : PHP, PHP Classes, Debugging Click here to Update Your Picture
Ben Yacoub Hatem
Date : Feb 26th 2005
Grade : 4 of 5 (graded 2 times)
Viewed : 5689
File : 4086.zip
Images : No Images for this code example.
Search : More code by Ben Yacoub Hatem
Action : Grade This Code Example
Tools : My Examples List

  Submit your own code examples 
 

Buggy uses its own database abstraction that you can change to allow store all queries used in the system in database.

First you should include db2.class.php and buggy.class.php
then initialize the Buggy object :

// 3 for Debug level - 0 production system
Buggy::_init(3);

Then start the Buggy system in the beginning of the code :
Buggy::StartScript();

This will log the event "Begin script execution" in the database and start a timer wich will give the total time execution of the script.

Then put this before last code executed in script
Buggy::EndScript();

This will store the time used by the buggy's queries and the "End of script execution" event in database.

To log any other event in your code you can use for example :
Buggy::logMessage('AbstractDB', 'Begin', $query);
Buggy::SetMicroTime('AbstractDB');        

Where AbstractDB is the module, "Begin" is the event and $query the current executed query for example. then we can set a timer named "AbstractDB". After running the query we can get the time used with GetExecutionTime() and log the Event "End" for the AbstractDB module :

$time = Buggy::GetExecutionTime('AbstractDB');
Buggy::logMessage('AbstractDB', 'End', "Query done",$time);

Buggy log also all PHP errors in database.

You can read from the buggy table in database or just create a small web tool to create reports from it.

Any question or comment are welcomed.
Hatem
http://phptunisie.net



The class to check load time of your script VERY usefull for relatively slow applications, but not only..
Categories : PHP, PHP Classes, Debugging
A time measuring and performance benchmarking class
Categories : PHP, PHP Classes, Testing, Debugging, Date Time
A Custom Error Handling And Debugging Class
Categories : PHP, PHP Classes, Debugging, Errors and Logging
[PHP5] PHP Debugger and Helper
Categories : PHP, PHP Classes, Errors and Logging, Debugging, XML
very simple ftp class
Categories : PHP, PHP Classes, FTP
PHP Paypal IPN Integration Class v1.0.0
Categories : PHP, PHP Classes, Payment Gateways
A Timing Class
Categories : PHP, PHP Classes, Date Time
Create HTML forms dynamicly using Javascript & PHP
Categories : PHP, PHP Classes, Java Script
PhpView 0.1 - simple php viewer, using temporary files and frames.
Categories : PHP, PHP Options and Info, Debugging, HTML and PHP
usercounter class
Categories : PHP, PHP Classes, Databases, MySQL, Environment Variables
RSS parser. Parses RSS into an array. Quick and nasty but does the job. No checking is done for correct Tags, only correct XML. PHP4 needed to display result (uses print_r).
Categories : PHP, XML, PHP Classes, Rich Site Summary (RSS)
ElfReader: An ELF (Executable and Linking Format) header information in PHP. Shows how to use the UNPACK function to read data.
Categories : PHP, Linux, PHP Classes
an example of the cyberlib payment class
Categories : PHP, PHP Classes, Ecommerce, Credit Cards
Power Form Validation
Categories : PHP, PHP Classes, Data Validation
MySQL Handler
Categories : PHP, Databases, MySQL, Classes and Objects, PHP Classes