How to Install DebugKit on CakePHP

前端 未结 3 704
Happy的楠姐
Happy的楠姐 2020-12-01 05:30

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

相关标签:
3条回答
  • 2020-12-01 06:08

    its simply a version problem. download the compatible version of DebugKit it should run without any error. confirmed!

    0 讨论(0)
  • 2020-12-01 06:09

    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)

    0 讨论(0)
  • 2020-12-01 06:25

    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.

    0 讨论(0)
提交回复
热议问题