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?

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

Main resources:

Total runtime0.0139 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 589.1641152.6406
Module start 'layout' 0.00600.0023 741.804739.4766
Module start 'content' 0.00830.0037 781.2813101.4922
Module end 'content' 0.01200.0019 882.773442.3047
Script end 0.0139  925.0781 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002417.5027140.0002
Check MTime0.00117.9159140.0001
Mysql Total
Database connection0.00117.790810.0011
Mysqli_queries0.002517.819730.0008
Looping result0.00000.085710.0000
Template Total0.001611.210.0016
Template load0.00085.864510.0008
Template processing0.00075.317810.0007
Override
Cache load0.00064.017110.0006
General
dbfile0.00021.467080.0000
String conversion0.00000.049740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs