Disable CakePHP DebugKit

I recently installed the insanely useful DebugKit plugin for my CakePHP projects, and I just realized that something wasn’t working the way I expected it to work. I assumed that when I pushed the code to release, DebugKit would not appear because my debug value is 0.

Although I haven't clicked on a release yet, I had to disable the plugin in my dev environment, and it seems that just setting the debug value is 0not enough. I really needed to remove the plugin from mine AppControllerin order to stop it ... debugging.

Is this expected? There are no specific shutdown instructions, but I made one of those assumptions that the installation Configure::write( 'debug', 0 )would be sufficient. Is this a mistake or was my expectation simply wrong?

Thank.

+5
source share
2 answers

Absolutely, in CakePHP 1.2 I do this.

In my app_controller.php, I use the following.

public function constructClasses() {

    if(Configure::read('debug') >= 1):
    $this->components[] = 'DebugKit.Toolbar';
    endif;

    parent::constructClasses();
}

Simple and elegant.

+6
source

just go to the core.php file in the / Config application

find this line Configure::write('debug', 2);

change to Configure::write('debug', 0);

0
source

All Articles