tags:

views:

210

answers:

3

Hello All:

I've been with this awful problem for hours, Googled as much as I can but still unlucky to figure out the solution.

The problem is:

each page rendered by CakdPHP has a default trailing timing benchmark comment, such as:

<html>
   <head />
   <body />
</html>
<!-- 3.4533s !-->

How can I remove the last line?enter code here?

+5  A: 
// core.php or anywhere else:
Configure::write('debug', 0);
deceze
Thanks so much for this tip!I'd searched on google for quite a while before...
Michael Mao
Whoever just voted this up got me to 2500 rep. Please don't vote on my stuff for a little while, it's a nice number. ^_^
deceze
A: 

you'll find the ouput in webroot/index.php

just remove:

echo "<!-- " . round(getMicrotime() - $TIME_START, 4) . "s -->";

at the end of the file.

faulancer
It's useful to have for debugging purposes, you really shouldn't remove it completely. If you need to disable it because, for example, you're outputting XML, use The Intended Way™ to do it.
deceze
A: 

Turn of debugging.

In AJAX heavy apps, I ensure I use the request handler component by putting it in the components list of any controller that will respond to AJAX requests.

var $components = array('RequestHandler');

I then put this the beforeFilter() method of the controller:

if ($this->RequestHandler->isAjax()) {
 Configure::write('debug', 0);
}
Chris Hawes