Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Install DebugKit on CakePHP

Tags:

cakephp

I'm learning how to work with CakePHP and I configured everything allright, but now, I get this warning:

DebugKit is not installed. It will help you inspect and debug different aspects of your application. You can install it from github

I already clicked on that link, and downloaded that app, but I have no idea where to place these folders... I'm using EasyPhp as my web host.
Also Here I followed the steps,
and there is:

`Ensure the plugin is loaded in app/Config/bootstrap.php by calling CakePlugin::load('DebugKit');` 

But I don't know how to call something here, is there a prompt ?

like image 374
PlayHardGoPro Avatar asked Feb 27 '13 23:02

PlayHardGoPro


2 Answers

How to Install DebugKit for CakePHP (in just 4 easy steps!):

STEP 1 (option A): The traditional / download method:

Create a DebugKit folder within your app/Plugin directory, and put the contents of the download into it (not the top-level folder - the stuff within it). If you know how to clone from github, that works fine also.


STEP 1 (option B): The Composer method

This seems to currently be the most popular option (and for good reason). If you're already using Composer [find out more about it here], then adding DebugKit is crazy-simple. If you haven't used Composer before, don't worry - just use "option A" above. The end-result is the same, and it's easy too.

Ensure require is present in composer.json. This will install the plugin into Plugin/DebugKit:

{
    "require": {
        "cakephp/debug_kit": "2.2.*"
    }
}

STEP 2:

Then, in your app/Config/bootstrap.php, add (or un-comment) the following line:

CakePlugin::load('DebugKit');

Lastly, in your app/Controller/AppController.php file (within the class), add:

public $components = array(
    'DebugKit.Toolbar'
);

(If you already have a $components array, then just add to it - don't re-set it.)


STEP 3: Ensure debug is 1 or more

In your Config/core.php file, make sure this line:

Configure::write('debug', 2);

has a value of 1 or 2. (read more about debug mode here)


STEP 4: Remove sql_dump:

In your layout file, remove the 'sql_dump' element (at the bottom of the default layout)


According to the "Installation" section on the debugKit page:

  • Clone/Copy the files in this directory into app/Plugin/DebugKit
  • Ensure the plugin is loaded in app/Config/bootstrap.php by calling CakePlugin::load('DebugKit');
  • Include the toolbar component in your AppController.php: public $components = array('DebugKit.Toolbar');
  • Set debug mode to at least 1.
  • Make sure to remove the 'sql_dump' element from your layout if you want to experience the awesome that is the debug kit SQL log.

How do I know if it's working?

You should see a small icon on a gray square in the upper right corner of your site. Click on this to expand the options, then click on an option to start being awesome.

like image 185
Dave Avatar answered Oct 20 '22 19:10

Dave


in the root application folder: go to \vendor\cakephp\ copy the folder debug_kit and paste it in \plugins folder, this worked for me in a heroku deployment (not production, only for development)

like image 32
user2998154 Avatar answered Oct 20 '22 17:10

user2998154