31 March 2009 View Comments

Scienta Zend Framework Debug Bar

Scienta Debug Bar

Scienta ZF Debugbar is a useful tool to add to your sites running on Zend Framework to get server side information of the page being accessed. It’s quite simple to use – just download the code, place it in your PHP include path and use the following code in your bootstrap file to get the debug bar to appear at the end of your page:

$options = array(
   'database_adapter' =>  $dbAdapter, // or array of adapters
   'memory_usage' =>      TRUE, // default value shown
   'collect_view_vars' => TRUE,
   'sort_view_vars' =>    TRUE,
   'show_exceptions' =>   TRUE,
   'handle_errors' =>     FALSE
);
 
$scBar = new Scienta_Controller_Plugin_Debug($options);
$frontController = Zend_Controller_Front::getInstance();
$frontController->registerPlugin($scBar);

The debug bar also gives you quick access to:

  • the variables used in the page
  • errors generated in that page
  • Database queries and time taken (if you’re using the Zend DB libraries)
  • the time taken to execute the script and more.

Get more information on this at the project site: http://jokke.dk/software/scientadebugbar

Reblog this post [with Zemanta]

Leave a Reply

blog comments powered by Disqus