Turning off debug for xml output

Friday 19 August 2011 12:52:33 am

By : Steven E. Bailey

So I'm trying to debug a site which has ajax calls to a module that serves xml.  Of course the debug output appended to the xml breaks it.  I've had this problem before but I never bothered looking closer at it until now.

So, I added this:

    if (preg_grep('@Content-Type: text/xml.*@', headers_list() ) )
        return null;

to index.php right after the:

     if ( $ini->variable( 'DebugSettings', 'DebugOutput' ) != 'enabled' )
        return null;

check in the eZDisplayDebug function.  Works like a charm.

So, worth a git pull?  Maybe it should be anything that's not "text/html" instead?  Is there some eZ way of doing this that I overlooked?

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 00:07:46
Script start
Timing: Jan 18 2025 00:07:46
Module start 'layout'
Timing: Jan 18 2025 00:07:46
Module start 'content'
Timing: Jan 18 2025 00:07:46
Module end 'content'
Timing: Jan 18 2025 00:07:46
Script end

Main resources:

Total runtime0.0841 sec
Peak memory usage6,144.0000 KB
Database Queries42

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0048 593.2656152.6406
Module start 'layout' 0.00490.0029 745.906339.4688
Module start 'content' 0.00780.0751 785.3750352.0234
Module end 'content' 0.08280.0012 1,137.398415.7031
Script end 0.0840  1,153.1016 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00283.3757150.0002
Check MTime0.00111.3660150.0001
Mysql Total
Database connection0.00091.016910.0009
Mysqli_queries0.045754.3106420.0011
Looping result0.00020.2955400.0000
Template Total0.049458.720.0247
Template load0.00192.231220.0009
Template processing0.047556.468120.0237
Template load and register function0.00010.145210.0001
states
state_id_array0.00080.980010.0008
state_identifier_array0.00060.771920.0003
Override
Cache load0.00151.8084120.0001
Sytem overhead
Fetch class attribute name0.00171.992130.0006
class_abstraction
Instantiating content class attribute0.00000.009930.0000
General
dbfile0.00060.7631100.0001
String conversion0.00000.008540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplblog_entry/full.tplextension/community_design/design/suncana/override/templates/blog_entry/full.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezkeyword.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezkeyword.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 11
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs