1 <?xml version="1.0" encoding="UTF-8"?>
3 <sect3 id="zend.db.profiler.profilers.firebug">
4 <title>Profiling with Firebug</title>
7 <classname>Zend_Db_Profiler_Firebug</classname> sends profiling infomation to the
8 <ulink url="http://www.getfirebug.com/">Firebug</ulink> <ulink
9 url="http://getfirebug.com/logging.html">Console</ulink>.
13 All data is sent via the <classname>Zend_Wildfire_Channel_HttpHeaders</classname>
14 component which uses <acronym>HTTP</acronym> headers to ensure the page content is not
15 disturbed. Debugging <acronym>AJAX</acronym> requests that require clean
16 <acronym>JSON</acronym> and <acronym>XML</acronym> responses is possible with this approach.
26 Firefox Browser ideally version 3 but version 2 is also supported.
32 Firebug Firefox Extension which you can download from <ulink
33 url="https://addons.mozilla.org/en-US/firefox/addon/1843">https://addons.mozilla.org/en-US/firefox/addon/1843</ulink>.
39 FirePHP Firefox Extension which you can download from <ulink
40 url="https://addons.mozilla.org/en-US/firefox/addon/6149">https://addons.mozilla.org/en-US/firefox/addon/6149</ulink>.
45 <example id="zend.db.profiler.profilers.firebug.example.with_front_controller">
46 <title>DB Profiling with Zend_Controller_Front</title>
48 <programlisting language="php"><![CDATA[
49 // In your bootstrap file
51 $profiler = new Zend_Db_Profiler_Firebug('All DB Queries');
52 $profiler->setEnabled(true);
54 // Attach the profiler to your db adapter
55 $db->setProfiler($profiler)
57 // Dispatch your front controller
59 // All DB queries in your model, view and controller
60 // files will now be profiled and sent to Firebug
64 <example id="zend.db.profiler.profilers.firebug.example.without_front_controller">
65 <title>DB Profiling without Zend_Controller_Front</title>
67 <programlisting language="php"><![CDATA[
68 $profiler = new Zend_Db_Profiler_Firebug('All DB Queries');
69 $profiler->setEnabled(true);
71 // Attach the profiler to your db adapter
72 $db->setProfiler($profiler)
74 $request = new Zend_Controller_Request_Http();
75 $response = new Zend_Controller_Response_Http();
76 $channel = Zend_Wildfire_Channel_HttpHeaders::getInstance();
77 $channel->setRequest($request);
78 $channel->setResponse($response);
80 // Start output buffering
83 // Now you can run your DB queries to be profiled
85 // Flush profiling data to browser
87 $response->sendHeaders();