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
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
Mobile Dev World

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 : 8395
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 Custom Error Handling And Debugging Class
Categories : PHP, PHP Classes, Debugging, Errors and Logging
A time measuring and performance benchmarking class
Categories : PHP, PHP Classes, Testing, Debugging, Date Time
[PHP5] PHP Debugger and Helper
Categories : PHP, PHP Classes, Errors and Logging, Debugging, XML
Password reminder
Categories : PHP, PHP Classes, Databases, MySQL, Mail
Form Elements Class
Categories : PHP, PHP Classes, Form Processing
Filter - A simple class that lets you use multiple functions to create custom filters.
Categories : PHP, PHP Classes, Strings
DbObject - A PHP wrapper for working with various databases
Categories : Databases, PHP, PHP Classes
Simple class that uses GD to draw pie charts. After the class definition there's some sample code to demonstrate how you use the class.
Categories : Graphics, PHP, PHP Classes, GD image library, Charts and Graphs
Browser Detecor Class
Categories : PHP Classes, PHP, HTML
Bs_IniHandler is a class that can read and write ini-style files (and strings)
Categories : PHP, Filesystem, PHP Classes
Specify your connection settings and create a link to a MySQL database.
Categories : PHP, PHP Classes, Databases, MySQL, Beginner Guides
PHP Zip Utility
Categories : PHP, PHP Classes, Compression
Example of function to send out email if error occurs
Categories : PHP, Email, Debugging, Errors and Logging
Customizable Calendar Class
Categories : HTML and PHP, Date Time, PHP, PHP Classes, Calendar