ZFDebug: A Useful Tool for Zend Framework Developers
Just in case you don’t know ZFDebug yet: ZFDebug is a precious litte helper that will help you when developing Zend Framework applications. It takes only minutes to install it and it will provide a lot of information like memory usage, loaded files, database queries used, etc.
[offtopic] Before I start to tell you something about ZFDebug: sorry, for being “offline” during the last weeks. I’ve been involved in a project and simply didn’t find any time to post new articles on Web Punk.
[ontopic] ZFDebug is really a fancy little open source tool. You may use it to see all database queries (including there response time), all request parameters passed to the controller / action, all variables used in your view and lots of other interesting stuff. And best of all: it only takes a minute to install it.
First of all, download the latest version of ZFDebug here. After unzipping the package, browse to the \zfdebug\library folder and move the subfolder to the \library folder of your ZF application.
ZFDebug has a lot of options that you may edit. Please, have a look at the project WIKI for more information about all the options. However, here is a piece of code that you may copy & paste – basically, this is how I use ZFDebug in my projects: open your bootstrap.php file. You will probably have some code in your bootstrap to register different plugins, setup a database adapter, initialize the MVC pattern and so on. At the end of bootstrap use something like this to initialize ZFDebug
if ('development' == APPLICATION_ENVIRONMENT) {
$options = array(
'jquery_path' => 'http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js',
'plugins' => array('Variables',
'Html',
'Database' => array(),
'File' => array('basePath' => APPLICATION_PATH . '/application'),
'Memory',
'Time',
'Registry',
'Cache' => array('backend' => $cache->getBackend()),
'Exception')
);
$debug = new ZFDebug_Controller_Plugin_Debug($options);
$frontController->registerPlugin($debug);
}
As you can see, I’ll check the APPLICATION_ENVIRONMENT variable to make sure that ZFDebug is loaded only if we are on the dev machine. If you start your web application again, you should see the ZFDebug toolbar at the bottom of you page. Have fun ;-)
No related posts.

CSS Zend Garden
KingCrunchs kleine Welt
Awesome plugin….using it right now :)
Hi James,
fully agree! This plugin is really very helpful… ;-)
bye
Christian
where does the $cache comes from, could you post a picture of what the debug plugin does :)