Skip to end of metadata
Go to start of metadata

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[

Zend Framework: Zend_Toolbar Component Proposal

Proposed Component Name Zend_Toolbar
Developer Notes http://framework.zend.com/wiki/display/ZFDEV/Zend_Toolbar
Proposers Lead: Ben Scholzen
Contributor: Christoph Dorn
Zend Liaison TBD
Revision 1.0 - 11 June 2009: Initial Draft. (wiki revision: 7)

Table of Contents

1. Overview

Zend_Toolbar is a component which provides the developer with enhanced debugging functionallity. Inspired by the Scienta ZF Debug plugin, it provides you with useful information about the current request.

Instead of printing out the information as plain HTML, Zend_Toolbar exposes the debug information via headers, and displays them via a Firefox extension at the bottom of the browser. This gives you two major advantages; First, you can debug non-HTML responses (like JSON, generated images and so on). Second, you are able to debug requests in production environment without disturbing other users.

For allowing production debugging, the Zend_Toolbar Firefox extension allows to define hostnames and paths to debug, and let you provide a password, so unauthorized users will not get any debug information via the headers.

Prototype of the Toolbar in Firefox 3.0:

2. References

3. Component Requirements, Constraints, and Acceptance Criteria

  • This component will only support Firefox 3 and up (does anyone want to write an IE equivalent extension?).
  • This component will only display the toolbar when the user is authorized and debug information are available
  • This component must be backward compatible (e.g. a toolbar extension v2.0.0 should be able to display information from a 1.9.0)
  • This component will allow authorization via hostname/path prefixes (password only)
  • This component will allow to inspect variables and executed queries
  • This component will allow to inspect information about the router and evaluated routes
  • This component will display additional information like runtime, memory usage, filesize, etc.
  • This component will use Zend_Wildfire for communication between server and extension

4. Dependencies on Other Framework Components

  • Zend_Exception
  • Zend_Controller
  • Zend_Db
  • Zend_Wildfire

5. Theory of Operation

The component is instantiated in the bootstrap by calling Zend_Toolbar::init(); with regarding options, like e.g. a required password. When a request comes in, it collects all required information and appends them to the response object as headers at the end.

6. Milestones / Tasks

7. Class Index

  • Zend_Toolbar
  • Zend_Toolbar_Plugin

8. Use Cases

UC-01

Initialising Zend_Toolbar

UC-02

Initialising Zend_Toolbar with password protection

9. Class Skeletons

]]></ac:plain-text-body></ac:macro>

]]></ac:plain-text-body></ac:macro>

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Jun 11, 2009

    <p>Awesome. </p>

    <p>I was thinking of installing the Scienta toolbar for ZF in the coming week or so. Now I am happy to wait till Zend_Toolbar is released. <ac:emoticon ac:name="smile" /></p>

  2. Jun 11, 2009

    <p>Great stuff! Can you add some instructions how to install the toolbar? </p>

    1. Jun 11, 2009

      <p>There's nothing really functionall right now, but if you want to: Pack all files inside the extension folder into a zip file with the extension .xpi and drag it into your firefox.</p>

  3. Jun 11, 2009

    <p>Great! very interesting.</p>

    <p>For the ouput, this will be cool to be able to add Filter (with Zend_Filter). to filter password or any other content with security risk. Scienta ZFDebug when it throw an exception it put in clear all database password/username in the configuration. its not very good.</p>

  4. Jun 11, 2009

    <p>Zend_Debug_Toolbar. <ac:emoticon ac:name="smile" /></p>

    1. Jun 12, 2009

      <p>+1, better name, I was thinking that Zend_Toolbar was something like Joomla's admin toolbar (<a class="external-link" href="http://api.joomla.org/Joomla-Framework/HTML/JToolBar.html">http://api.joomla.org/Joomla-Framework/HTML/JToolBar.html</a>) :|</p>

    2. Jun 12, 2009

      <p>Another +1 from me for Zend_Debug_Toolbar. </p>

    3. Jun 14, 2009

      <p>Good idea, makes sense to put it under the Zend_Debug namespace. That by the way also stops auto-completion failure of Zend_Tool <ac:emoticon ac:name="wink" /></p>

  5. Jun 12, 2009

    <p>I think something useful that this could implement would be a custom error handler to display warnings, and other errors. I really like the plugin idea, and look forward to writing my own :></p>

  6. Jun 13, 2009

    <p>You should check the Nette_Debug class ( <a class="external-link" href="http://translate.google.com/translate?prev=hp&hl=cs&js=n&u=http%3A%2F%2Flatrine.dgx.cz%2Fladenka-jak-se-vam-libi&sl=cs&tl=en&history_state0=">http://translate.google.com/translate?prev=hp&amp;hl=cs&amp;js=n&amp;u=http%3A%2F%2Flatrine.dgx.cz%2Fladenka-jak-se-vam-libi&amp;sl=cs&amp;tl=en&amp;history_state0=</a> machine translated) It has some really useful features like:</p>
    <ul>
    <li>expading parts of code (context) for each stack trace entry</li>
    <li>displaying parameters from function calls</li>
    <li>enviroment info (included files and defined constants)</li>
    <li>it's under free licence</li>
    </ul>

    <p>It can handle both exceptions (<a class="external-link" href="http://examples.nettephp.com/ndebug/exception.html">http://examples.nettephp.com/ndebug/exception.html</a>) and errors (<a class="external-link" href="http://examples.nettephp.com/ndebug/user-error.html">http://examples.nettephp.com/ndebug/user-error.html</a>). It would be useful to have such features in an extension, rather than need to output them to the browser (useful for debug, but useless when solving live-runtime exceptions when using Error Controller <ac:emoticon ac:name="smile" /> )</p>

    1. Jun 14, 2009

      <p>I took a quick look at the examples and like the idea to display all possible information around function call parameters, surounding code and such. Will take that into account.</p>

  7. Jun 15, 2009

    <p>Wow! Can't wait to try it! <br />
    By the way, Scienta Toolbar is a greatest tool by now for debugging, thx a lot to it's authors.</p>

  8. Jun 16, 2009

    <p>This component should also allow an "output window" much like is available in many other languages (Think anything in visual studio, Flash), which can be coupled with a Zend_Debug_Toolbar::trace() method.</p>

    <p>This would allow a much nicer way to add debug messages, while keeping them private (due to the password protection). And if coupled with Zend_Log, can provide an easy way to swap between output types in production / staging / development.</p>

    <p>(yes i'm assuming it will be renamed to Zend_Debug_Toolbar <ac:emoticon ac:name="smile" /> )</p>

  9. Jul 14, 2009

    <p>I've reviewed the proposal and attempted to try it out, and have several comments.</p>

    <p>First off, I attempted to try it out. However, ZendL_Toolbar_Plugin has a dependency on Zend_Wildfire_Plugin_FrameworkToolbar – and could not find it anywhere. While your description tells what to expect, I'm having trouble visualizing it, and this was a show stopper. I'd like to see a working demo so that I can better understand the functionality you propose. In paticular, I'd like to see how one would interact with the toolbar to get information, and what exact information could be exposed.</p>

    <p>Second, I'd like to know if it's possible to expose additional information via logging/plugins. Having a log writer that was exposed via the toolbar could be a killer feature, and a plugin interface could make the tool grow with the framework and user needs.</p>

    <p>Third, integration with one or more debug protocols could also be useful, but not mandatory for acceptance.</p>

    <p>Finally, I think many commments were spot on about the naming: Zend_Debug_Toolbar makes more sense, component-wise.</p>

    <p>I'm re-parenting the proposal to "Laboratory"; please re-parent to Ready for Review (by community) once the above items have been answered/addressed, and start the process again.</p>

    <p>Looking forward to seeing continued development on this exciting component!</p>

  10. Mar 04, 2010

    <p>Nobody mentioned ZFDebug Bar? -> <a class="external-link" href="http://code.google.com/p/zfdebug/">http://code.google.com/p/zfdebug/</a><br />
    It is the further development of the Scienta Toolbar - much more actual..</p>

    <p>I don't like to see Zend_Debug_Toolbar working with/as a firefox extension. I want to use it in ALL browsers...</p>

    1. Mar 05, 2010

      <p>Ah I thought this was ZFDebug being integrated into ZF, and wanted to say; would be nice if there would be a Zend_Log_Writer for it too, but did not look good.</p>

  11. Mar 15, 2011

    <p>No news? I think that a toolbar is a must have for ZF2 <ac:emoticon ac:name="laugh" /></p>