2
votes

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
3
could you show us what line 165 in ToolbarComponent.php looks likE? - Andreas Wong
@SiGanteng See i updated my error with line no - Javascript Coder

3 Answers

6
votes

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.

3
votes

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.

2
votes

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.