Christoph,

I think that's pretty cool. I see you also created
FirePhp_Log_Writer_FirePhp for general logging, I have to try that out. Nice
work, maybe this could become a part of the standard ZF library (?)

Cheers


ChristophDorn wrote:
> 
> You can now profile your ZF DB queries and send them to the Firebug
> console. See screenshot attached.
> 
> Requirements:
> 
> - Firebug Firefox Plugin from http://www.getfirebug.com/
> - FirePHP Firefox Plugin from http://www.firephp.org/
> - FirePHP Core Library from http://www.firephp.org/
> - FirePHP Zend Framework Library from
> http://firephp.googlecode.com/svn/trunk/Libraries/ZendFramework/
> 
> There is a simple demo app showing all current features in the "demo/"
> folder.
> 
> 
> Here is some sample code to profile your DB queries:
> 
> 
> $params = array(
>     'dbname'   => ':memory:',
>     'profiler' => new FirePhp_Db_Profiler_FirePhp()
> );
> $db = Zend_Db::factory('PDO_SQLITE', $params);
> $db->getProfiler()->setEnabled(true);
> 
> $db->getConnection()->exec('CREATE TABLE foo (
>                               id      INTEGNER NOT NULL,
>                               col1    VARCHAR(10) NOT NULL
>                             )');
> 
> $db->insert('foo', array('id'=>1,'col1'=>'original'));
> 
> $db->fetchAll('SELECT * FROM foo WHERE id = ?', 1);
> 
> $db->update('foo', array('col1'=>'new'), 'id = 1');
> 
> $db->fetchAll('SELECT * FROM foo WHERE id = ?', 1);
> 
> $db->delete('foo', 'id = 1');
> 
> $db->getConnection()->exec('DROP TABLE foo');
> 
> $db->getProfiler()->flush();
> 
> 
> Let me know what you think. If you are interested in enhancing the
> FirePHP ZF Library why don't you head over to the FirePHP mailing list
> (http://groups.google.com/group/FirePHP) to discuss your ideas.
> 
> Christoph
> 
> 
> 
>  
> 

-- 
View this message in context: 
http://www.nabble.com/FirePHP-and-Zend_Db_Profiler-tp17737652p17751188.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to