PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, January 16, 2022

[FIXED] Disable CakePHP DebugKit

 January 16, 2022     cakephp, cakephp-1.3     No comments   

Issue

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.


Solution

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.



Answered By - Tass Skoudros
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing