Deprecated: This code uses an old version of Doctrine and Zend Framework, there is now an semi-official way of integrating Doctrine and Zend Framework, see the announcement of the zf-doctrine project and checkout my plugin for ZFDebug to have access to the Doctrine Profiler: http://github.com/danceric/zfdebugdoctrine

This is a follow-up to my post: Doctrine ORM and the Zend Framework

ZFDebug is a debug bar for Zend Framework, largely inspired by the Symfony Debug Bar. I have created a ZFDebug plugin that displays informations form the Doctrine profiler in the debug bar. You can see the sample code on my GitHub repository for zfdebugdoctrine.

If you already know how to use ZF, Doctrine and ZFDebug, you can jump right to the zfdebug doctrine plugin file.

update 2009/10/29: This was build with ZFDebug 1.5, Zend Framework 1.8 and Doctrine 1.1, you can check out Doctrine 1.2 is Zend Framework friendly too.

Posted in php.

5 thoughts on “ZFDebug and Doctrine ORM

  1. Hi, Dan!

    There is htmlspecialchars() missing for bindings list that cause to output direct html in case it appears in binding.

    So I created a patch for it:

    --- /zfdebugdoctrine/library/Danceric/Controller/Plugin/Debug/Plugin/Doctrine.php   Пт июл 24 12:51:05 2009
    +++ /danceric/zfdebugdoctrine/library/Danceric/Controller/Plugin/Debug/Plugin/Doctrine.php  Пт июл 24 12:39:28 2009
    @@ -103,8 +103,14 @@
                        $html .= $info;
    
                        $params = $event->getParams();
    -                   if(!empty($params)) {
    -                       $html .= '<ul><em>bindings:</em> <li>'. implode('</li><li>', $params) . '</li></ul>';
    +                   if(!empty($params))
    +                   {
    +                       $html .= '<ul><em>bindings:</em>';
    +                       foreach( $params as $param )
    +                       {
    +                           $html .= '<li>' . htmlspecialchars( $param ) . '</li>';
    +                       }
    +                       $html .= '</ul>';
                        }
                        $html .= '</li>';
                    }
    
  2. Pingback: Routy Design » Integrating ZFDebug and Doctrine Query Profiling into your Zend Application

  3. Works for me which is great, thank you! I may tinker with it to be a bit more descriptive :)

Comments are closed.