CakePHP DebugKit Plugin Toolbar doesn't appear

2019-07-20 22:28发布

问题:

Hello and thanks in advance for your help! Multiple attempts at installation of CakePHP's DebugKit Plugin unsuccessful

Steps Attempted: 1. Download and and unzipped debug_kit (https://github.com/cakephp/debug_kit) 2. Renamed file to "DebugKit" and moved to /webroot/cakephp/plugins (so that its inside the plugins folder). 3. Made the following modifications to the appropriate files. (I've double and triple checked these)

# Installation

* 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 `app/Controller/AppController.php`:
```php
class AppController extends Controller {
         public $components = array('DebugKit.Toolbar');
}
```
* Set `Configure::write('debug', 1);` in `app/Config/core.php`.
* Make sure to remove the 'sql_dump' element from your layout (usually
  `app/View/Layouts/default.ctp` if you want to experience the awesome that is
  the debug kit SQL log.

When I got to my localhost/cakephp I see the other notifications and I have everything else configured so that they appear green. However Cakephp doesn't even see that I'm attempting to use the DebugKit plugin and the toolbar is not displayed.

I am new to CakePHP and have been working through tutorials to get everything set up correctly. I thought that the DebugKit would be incredibly helpful in helping me understand CakePHP. I have gone through several tutorials and searched the internet but I have been unable to get it to work. If you have any ideas please let me know!

NOTE: CakePHP Version 2.4.6 DebugKit 2.2.1 (also tried newer version) LAMP install on Ubuntu 12.04

回答1:

  1. In cakePHP root directory > plugins' folder, that is where DebugKit should stay.
  2. Then you need to make the kit available to everybody by loading it in bootstrap. In app > config > bootstrap.php add this line;
CakePlugin::load('DebugKit');