Not sure I understand the problem. Do you expect Cake to format it's
debug information based on the content type? It's debug information -
it's meant for debugging.
You can type Configure::write('debug', 0) at the top of any action in
order to lower the debug level selectively per action without having
to shut if off for the entire app.
I have lots of views in a particular application that return XML or
JSON, and of course having debug info at the bottom of that response
will break those requests. Once I confirm the response is returning
correctly formatted XML or JSON, I turn the debugging off for that
action.... and only turn it back on in that action in the event I need
to debug :P
Good luck,
James
On Dec 6, 6:24 pm, Rob <[EMAIL PROTECTED]> wrote:
> I'll probably get no response or flames telling me to "just set debug
> to 1", but ....
>
> I've set up my VolunteerCake code to be a RESTful web service by using
> the Router::parseExtensions() and Router::mapResources() magic. This
> works fine as long as debug is not greater than 1.
>
> When debug is greater than 1 however, the XML that gets returned is
> broken due to problems with the way the SQL debug is spit out.
>
> I traced this down to a call In the close() function of
> dbo_source.php, to showLog() which spits out the SQL in an HTML table
>
> I call the web service and get the XML as expected. The closing XML is
> followed by the dump of the SQL like:
>
> </VolunteerCake><!-- 0.9699s --><table class="cake-sql-log"
> id="cakeSqlLog_1228604311493b0397a19568_61229664" summary="Cake SQL
> Log" cellspacing="0" border = "0">
> <caption>(default) 36 queries took 127 ms</caption>
>
> Other web service tools I've worked with operate by giving you access
> to the debug data so you can spit it out as part of the XML if you
> want to, so you end up with something like:
>
> <VolunteerCake><myData>non-debug data</myData><debug>debug data
> (usually wrapped in a CDATA)</debug></myData></VolunteerCake>
>
> Ideally Cake shouldn't be changing the content-type and spitting out
> HTML after the well-formed document has been created anyway.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---