ZFDebug and Doctrine ORM

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 Saturday, June 6th, 2009 under php.

5 comments

  1. Oleg says:

    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. Oleg says:

    Whoops, some code here also became html. Please fix it! And thanks for this plugin!

  3. apit says:

    hi, thx for your plugin. works great :) .

  4. Alex Gemmell says:

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