5

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 code to production, the DebugKit wouldn't show up because my debug value is 0.

Although I haven't pushed to production yet, I did have a need to disable the plugin in my dev environment and it seems that simply setting the debug value to 0 isn't enough. I actually had to remove the plugin from my AppController to get it to stop...debugging.

Is this expected? There are no specific instructions for disabling, but I made one of those assumption things that setting Configure::write( 'debug', 0 ) would suffice. Is this a bug or was my expectation just wrong?

Thanks.

1
  • Argh. I'm not finding that to be the case. Maybe I have some goofy caching stuff going on? Commented Jul 13, 2011 at 21:14

3 Answers 3

6

Absolutely right, 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();
}

Its simple and elegant.

Sign up to request clarification or add additional context in comments.

1 Comment

Brilliant! Thanks, Tass. From the way the instructions are worded, I guess I just assumed that the debug value was the show/hide key. Stupid me.
0

just go to core.php file in app/Config

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

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

Comments

0

In config/app.php you will see ...


'debug' => filter_var(env('DEBUG', true), FILTER_VALIDATE_BOOLEAN),


by default it is set to true, change it to false. that is..

'debug' => filter_var(env('DEBUG', false), FILTER_VALIDATE_BOOLEAN),

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.