Thursday 04 September 2008 7:56:42 pm - 7 replies
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
Thursday 04 September 2008 9: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();
Modified on Thursday 04 September 2008 9:14:04 pm by André R.
Friday 05 September 2008 1:46:11 am
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
Tuesday 21 April 2009 10: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?
You must be logged in to post messages in this topic!