Debug disabled only on a certain modules view

Author Message

H-Works Agency

Wednesday 19 May 2010 4:26:04 am

Hello,

Is there a php directive that allow to disable debug output on a custom module view ?

Debug would be activated with regular process, but not a certain modules view.

Would be a great help for developers whom use customs views for ajax queries.

Regards,

EZP is Great

André R.

Wednesday 19 May 2010 5:14:56 am

This is how ezjscore handles it (and ezoe for it's ajax views as well, but without using view parameter to conditionally enable it):

$debugOutput    = isset($Params['debug']) ? $Params['debug'] : false;
if ( $debugOutput && ( $contentType === 'xml' || $contentType === 'xhtml' ) )
{
    echo "<!--\r\n";
    eZDebug::printReport( false, false );
    echo "\r\n-->";
}
else if ( $debugOutput && $contentType === 'json' )
{
    echo "/*\r\n";
    eZDebug::printReport( false, false );
    echo "\r\n*/";
}
eZDB::checkTransactionCounter();
eZExecution::cleanExit();

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Gaetano Giunta

Thursday 20 May 2010 12:18:40 am

A simpler, albeit hackish way, is to use this tag in the pagelayout template that you will conditionally apply to your views:

<!-- <!--DEBUG_REPORT--> -->

Btw, the printing of that data should definitely be passed out to a customizable handler...

Principal Consultant International Business
Member of the Community Project Board

H-Works Agency

Thursday 20 May 2010 1:15:53 am

Hello

Those directives doesn't work, if i add : eZDebug::printReport( false, false ) this just output an ezdebug object and my content is not returned anymore.

My question was "In a custom module view, how to disable debug output if debug is enabled else where".

EZP is Great

Yannick Komotir

Wednesday 14 July 2010 3:12:41 am

with this on top of your view ?

eZDebug::updateSettings(array(
    "debug-enabled" => false,
    "debug-by-ip" => false
));

<|- Software Engineer @ eZ Publish developpers -|>
@ http://twitter.com/yannixk

H-Works Agency

Wednesday 14 July 2010 12:28:05 pm

Great this time its working ! Thanx a lot.

EZP is Great

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 02:04:56
Script start
Timing: Jan 18 2025 02:04:56
Module start 'layout'
Timing: Jan 18 2025 02:04:56
Module start 'content'
Timing: Jan 18 2025 02:04:57
Module end 'content'
Timing: Jan 18 2025 02:04:57
Script end

Main resources:

Total runtime1.1880 sec
Peak memory usage4,096.0000 KB
Database Queries70

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0069 588.0547152.6406
Module start 'layout' 0.00690.0036 740.695339.4766
Module start 'content' 0.01041.1760 780.1719663.1719
Module end 'content' 1.18650.0015 1,443.343816.1250
Script end 1.1880  1,459.4688 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.2698160.0002
Check MTime0.00130.1094160.0001
Mysql Total
Database connection0.00130.108010.0013
Mysqli_queries1.121994.4379700.0160
Looping result0.00070.0578680.0000
Template Total1.152397.020.5761
Template load0.00240.199220.0012
Template processing1.149996.788520.5749
Template load and register function0.00010.008910.0001
states
state_id_array0.00120.098210.0012
state_identifier_array0.00190.164020.0010
Override
Cache load0.00210.1746300.0001
Sytem overhead
Fetch class attribute can translate value0.00070.056640.0002
Fetch class attribute name0.00160.1369100.0002
XML
Image XML parsing0.00200.168640.0005
class_abstraction
Instantiating content class attribute0.00000.0017120.0000
General
dbfile0.00120.1041360.0000
String conversion0.00000.000840.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.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
6content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 24
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs