FrontEnd Expert
FrontEnd Expert

Reputation: 5803

How to use DebugKit toolbar in cakephp 2.1.3 or cakephp 2.0

I have tried to use cakephp Debugkit toolbar for cakephp 2.1.3... but it is not working fine..

I have implemented debugkit on cakephp 1.3 it is working fine..

i downloaded debugkit for cakephp 2.1.3. I rechecked that..

How i am implementing it??

app/plugin/DebugKit   ///this is my path for debugkit

I checked my debug mode is 2..

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

how i am loading my debug kit in Appcontroller..'

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

It is showing error

Parse error: syntax error, unexpected T_FUNCTION in /var/www/guest1/cakephp-2.1.3/app/Plugin/debug_kit/Controller/Component/ToolbarComponent.php on line 165

I download debugkit from different source but same result.

Thanks !

it is showing error in this function and line

public function implementedEvents() {
    $before = function ($name) {
        return function () use ($name) {
            DebugTimer::start($name, __d('debug_kit', $name));
        };
    };
    $after = function ($name) {
        return function () use ($name) {
            DebugTimer::stop($name);
        };
    };

I loaded file in bootstrap.php at the end

CakePlugin::loadAll(); 

Error:-

    Error: DebugKit.ToolbarComponent could not be found.

Error: Create the class ToolbarComponent below in file: /var/www/guest1/cakephp-2.1.3/app/Plugin/DebugKit/Controller/Component/ToolbarComponent.php

Upvotes: 2

Views: 8738

Answers (3)

Mike
Mike

Reputation: 81

I had the same problem. DebugKit worked on my local server, but crashed with the same error online. The problem was that i didn't have a database connection. After i succesfully connected to the database, debugkit worked fine.

Upvotes: 2

user1145716
user1145716

Reputation: 47

I have same problem. I guess if you are using Cakphp 2.0 and higher, you cannot use Debugkit version lower than 2 because it has a different Plugin name convention. Files have a different tree structure.

So all you have to do is use a lower version and rename the files or update PHP or use lower version of Cakephp.

Upvotes: 3

dr Hannibal Lecter
dr Hannibal Lecter

Reputation: 6721

You have downloaded the latest version of the DebugKit plugin, which uses closures. As you can see there, you need at least PHP 5.3 for this to work.

Simply download an earlier version of DebugKit which is compatible with your version of PHP.

Upvotes: 6

Related Questions