This gist shows an easy way to include DebugKit as a new debug level in your CakePHP applications. You'll first need to install the DebugKit plugin and then add the following code:
// Load DebugKit only if debug level is greater than 3
if (Configure::read('debug') >= 3) {
CakePlugin::load("DebugKit");
}
Either add beforeFilter() or include the lines below.
public function beforeFilter() {
// Load DebugKit Toolbar only if debug level is greater than 3
if (Configure::read('debug') >= 3) {
$this->Toolbar = $this->Components->load('DebugKit.Toolbar');
}
parent::beforeFilter();
}
Add a condition around the sql_dump element in your layout.
<?php if (in_array(Configure::read('debug'), array(1, 2))): ?>
<?php echo $this->element('sql_dump'); ?>
<?php endif; ?>
public function __construct() {
if (Configure::read('debug') >= 3) {
$this->components[] = 'DebugKit.Toolbar';
Configure::write('debug', 2);
}
parent::__construct();
}
<?php if (in_array(Configure::read('debug'), array(1, 2))): ?>
<?php echo $this->element('sql_dump'); ?>
<?php endif; ?>
debug
at level 3 hasn't been a thing since 1.2. It went away because having a controller dump was wasting too much memory. Anything higher than 2 is essentially setting it at 2.