ZF-6325: Pass profiling information to all Zend Db query methods. __LINE__, __FILE__, scalar or string values for debugging and identifying line position of query

Issue Type: New Feature Created: 2009-04-16T12:04:13.000+0000 Last Updated: 2010-02-17T08:28:33.000+0000 Status: Resolved Fix version(s): Reporter: Michael Christensen (simplifiedweb) Assignee: Ralph Schindler (ralph) Tags: - Zend_Db

Related issues: Attachments:


For several years we have used our own DB layer and used the typical $db->query() method, however, we adapted our class to handle the passing of line level information, for example:

$query = $db->query("SELECT * FROM table", LINE, FILE);

In our own profiler, we could see where those particular queries were executed and in what file. It is very helpful if there is a problem with your query, but it goes unnoticed until you review the profiler results. Upon changing to the Zend Db Adapter, this missing feature was a big loss for us. I considered passing the information to the $bind argument, but I don't want to neglect the availability of using parameter placeholders. Additionally that wasn't the intended use of the second argument for the Zend_Db_Statement.

I would love to hear any suggestions, or the response of a possible future inclusion of this feature.

Thank you!

A huge Zend Framework Fan Mike


Posted by Pieter Kokx (kokx) on 2010-02-17T08:28:33.000+0000

You can use the PHP function debug_backtrace() for this purpose.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.