[MANUAL] English:
[zend.git] / documentation / manual / en / module_specs / Zend_Db_Profiler-Firebug.xml
blob2d9134f1e8c5f8d83fc042060dad859daedb9b5b
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- Reviewed: no -->
3 <sect3 id="zend.db.profiler.profilers.firebug">
4     <title>Profiling with Firebug</title>
6     <para>
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>.
10     </para>
12     <para>
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.
17     </para>
19     <para>
20         Requirements:
21     </para>
23     <itemizedlist>
24         <listitem>
25             <para>
26                 Firefox Browser ideally version 3 but version 2 is also supported.
27             </para>
28         </listitem>
30         <listitem>
31             <para>
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>.
34             </para>
35         </listitem>
37         <listitem>
38             <para>
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>.
41             </para>
42         </listitem>
43     </itemizedlist>
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
61 ]]></programlisting>
62     </example>
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
81 ob_start();
83 // Now you can run your DB queries to be profiled
85 // Flush profiling data to browser
86 $channel->flush();
87 $response->sendHeaders();
88 ]]></programlisting>
89     </example>
90 </sect3>
91 <!--
92 vim:se ts=4 sw=4 et:
93 -->