How to change your DEBUG level on the fly

14 Oct 2007

The debugging features of cakePhp is very very helpful to me specially the full debug with sql. Sometimes it's a bit irritating if your dealing with ajax calls. In looking at the cheesecake source code, I found this hack to change it to 0, 1, 2 or 3 on the fly:

PHP:
  1. Configure::write('debug',0);

Here is the complete code on how they handle ajax calls:

PHP:
  1. // Hack to prevent wierd output with AJAX
  2. if ($this->RequestHandler->isAjax()) {
  3. $db =& ConnectionManager::getDataSource('default');
  4. $db->fullDebug = false;
  5.  
  6. }

Design by: primerg | Images by: vikifloki | PETIXE.COM © 2007