[TYPO3-dev] Re: Extending QueryInterface with a $debug field
Olle Haerstedt
o.haerstedt at bitmotion.de
Mon Oct 27 13:34:05 CET 2014
Quote: Olle Haerstedt (ollehar) wrote on Mon, 27 October 2014 13:23
----------------------------------------------------
> Hi!
>
> It's a pain to debug queries in Extbase. What's the minimal change that can
> be done to the code base to ease this?
>
> One idea is to include a $debug boolean field, set to false as default, in the
> Query object. Then, when a query is processed, if $debug is true, the query
> will be dumped somehow.
>
> The $debug should be a setting for the query, like
> $query->getQuerySettings()->setDebug(TRUE);
> or
> ->setLogQuery(TRUE);
>
> For the dump part, I guess the log system of TYPO3 could be used? Or just
> var_dump or print_r, but that's not pretty.
>
> Any thoughts? Maybe there's already an issue reported about this?
>
> Regards
> Olle
>
>
----------------------------------------------------
OK, I see that in dev TYPO3, QueryInterface has an getStatement() function. I guess this
could be used as a debugging device.
Olle
More information about the TYPO3-dev
mailing list