Forums / Developer / Disable debug for custom layouts (/layout/set/xyz)

Disable debug for custom layouts (/layout/set/xyz)

Author Message

Patrick Kaiser

Thursday 04 September 2008 10:56:42 am

Hi,

does anyone know how to disable debug for custom layouts? We use custom layouts mostly for serving xml and json content which of course is not valid anymore once ez writes its debug output in it. This is only a problem during development, but its just anoying having to en/disable debug output all the time..

Thanks for any hint, best regards,

Patrick


Best regards,

Patrick

André R.

Thursday 04 September 2008 12:13:23 pm

Use a custom view, you can reuse the concepts from oe5, for instance.
outputs debug output as text in a javascript comment.

// Output debug info as js comment
echo "/*\r\n";
eZDebug::printReport( false, false );
echo "*/\r\n";

// output (echo) view result here

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

Gabriel Finkelstein

Thursday 04 September 2008 3:24:26 pm

The debug replaces this code:

<!--DEBUG_REPORT-->

in the pagelayout with the debug info. So, for your xml pagelayouts you could put:

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

And for your json pagelayouts:

/*<!--DEBUG_REPORT-->*/

Patrick Kaiser

Thursday 04 September 2008 4:46:11 pm

Thanks very much for your help!

Furthermore, wouldn't it be good to have a ini setting in layout.ini to en/disable debug for each custom layout? For xml and json output the normal ezdebug output doesnt make too much sense anyway..

Best regards,

Patrick


Best regards,

Patrick

André R.

Thursday 04 September 2008 11:46:52 pm

/layout/set aren't made for json/xml views, but this is of course something to keep in mind for projectV.

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

Mark Marsiglio

Saturday 13 September 2008 11:26:58 am

We add this to the end of our xml layouts:

{kill_debug()}

http://www.thinkcreative.com
Turning Ideas Into Strategic Solutions

Patrick Kaiser

Sunday 14 September 2008 4:41:33 am

interesting, would you mind to post the code of the kill_debug() template operator as well?

best regards,

Patrick


Best regards,

Patrick

Grégoire Paris

Tuesday 21 April 2009 1:02:46 am

Hi, I have tried to use the solutions proposed here, but none of them worked for me, so I have tried this :

include_once ('kernel/common/template.php');

$tpl = templateInit();

$Result=array();
$Result['pagelayout'] = "";
$old_level      = error_reporting(0);
$ezDebugObject  = eZDebug::instance();
$old_output     = $ezDebugObject->MessageOutput;
$ezDebugObject->setMessageOutput( eZDebug::OUTPUT_MESSAGE_STORE );
if( extension_loaded('xdebug') )
    xdebug_disable();
$Result['content']    = $tpl->fetch( 'design:clipping/export.tpl' );
$Result['path']       = array(array('url'=>'clipping/export','text'=>"Clipping"));
$ezDebugObject->setMessageOutput( $old_output );

, which did work on another project where I did not have to use templates. Why does not it work with templates? Isn't it possible to disable debug output in php for a given template?

eZ debug

Timing: Jan 18 2025 14:53:20
Script start
Timing: Jan 18 2025 14:53:20
Module start 'content'
Timing: Jan 18 2025 14:53:22
Module end 'content'
Timing: Jan 18 2025 14:53:22
Script end

Main resources:

Total runtime1.4181 sec
Peak memory usage4,096.0000 KB
Database Queries215

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 587.8438180.8125
Module start 'content' 0.00551.2846 768.6563739.3672
Module end 'content' 1.29010.1278 1,508.0234344.4297
Script end 1.4180  1,852.4531 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00420.2945210.0002
Check MTime0.00170.1203210.0001
Mysql Total
Database connection0.00040.028610.0004
Mysqli_queries1.316592.83522150.0061
Looping result0.00230.16532130.0000
Template Total1.392298.220.6961
Template load0.00210.146720.0010
Template processing1.390198.028420.6951
Template load and register function0.00020.016710.0002
states
state_id_array0.00050.033010.0005
state_identifier_array0.00070.049120.0003
Override
Cache load0.00180.1295440.0000
Sytem overhead
Fetch class attribute can translate value0.00140.100360.0002
Fetch class attribute name0.00110.0768130.0001
XML
Image XML parsing0.01060.745760.0018
class_abstraction
Instantiating content class attribute0.00000.0022160.0000
General
dbfile0.01581.1133500.0003
String conversion0.00000.000430.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
8content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
8content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
11content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
6content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 36
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs