Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...

When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Specialized Profilers

A Specialized Profiler is an object that inherits from Zend_Db_Profiler. Specialized Profilers treat profiling information in specific ways.

Profiling with Firebug

Zend_Db_Profiler_Firebug sends profiling infomation to the Firebug Console.

All data is sent via the Zend_Wildfire_Channel_HttpHeaders component which uses HTTP headers to ensure the page content is not disturbed. Debugging AJAX requests that require clean JSON and XML responses is possible with this approach.


Example 230. DB Profiling with Zend_Controller_Front

// In your bootstrap file

$profiler = new Zend_Db_Profiler_Firebug('All DB Queries');

// Attach the profiler to your db adapter

// Dispatch your front controller

// All DB queries in your model, view and controller
// files will now be profiled and sent to Firebug

Example 231. DB Profiling without Zend_Controller_Front

= new Zend_Db_Profiler_Firebug('All DB Queries');

// Attach the profiler to your db adapter

$request  = new Zend_Controller_Request_Http();
$response = new Zend_Controller_Response_Http();
$channel  Zend_Wildfire_Channel_HttpHeaders::getInstance();

// Start output buffering

// Now you can run your DB queries to be profiled

// Flush profiling data to browser

Zend Framework