Stack trace for sql query execution? (Zend Framework)
Is there a way to get the stack trace for each sql query using the db profiler?
I'm using the profiler like so:
foreach($profiler->getQueryProfiles() as $query) {
}
Which is fine as I ca开发者_运维技巧n get elapsed seconds, actual query etc but I want to know where this query was called from so I need the last 3 or 4 items in the stack trace.
Any ideas?
Extend Zend_Db_Profiler and use debug_backtrace()
in the queryEnd method.
精彩评论