2012-05-29 46 views
2

我曾嘗試使用CakePHP Debugkit工具欄cakephp 2.1.3 ...但它不能正常工作很好..如何使用工具欄DebugKit CakePHP中的2.1.3或2.0的CakePHP

我已經cakephp 1.3實施debugkit這是工作很好..

我下載了調試套件cakephp 2.1.3。我重新檢查..

我如何實現它?

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

我檢查我調試模式爲2 ..

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

如何我加載我的調試工具包中的AppController ..」

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

它顯示錯誤

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 

我從不同的源bu下載debugkit同樣的結果。

謝謝!

它表示在這個功能錯誤和線路

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); 
     }; 
    }; 

我裝在bootstrap.php中的文件在最後

CakePlugin::loadAll(); 

錯誤: -

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 
+0

你能告訴我們'ToolbarComponent.php'中的第165行看起來似乎嗎? –

+0

@SiGanteng看到我更新了我的錯誤行號 –

回答

2

我有同樣的問題。 DebugKit在我的本地服務器上工作,但在線上發生同樣的錯誤。問題是我沒有數據庫連接。在我成功連接到數據庫後,debugkit工作正常。

6

您已經下載最新版本的DebugKit插件,它使用closures。正如你可以看到的那樣,你至少需要PHP 5.3才能工作。

只需下載與您的PHP版本兼容的早期版本的DebugKit。

+0

好吧,謝謝讓我試試.. –

+0

我試過,但..它顯示錯誤,錯誤:DebugKit.ToolbarComponent找不到。和錯誤:在文件中創建類ToolbarComponent:/var/www/guest1/cakephp-2.1.3/app/Plugin/debug_kit/Controller/Component/ToolbarComponent.php .. –

+0

我再次檢查該文件存在。 。 –

3

我有同樣的問題。我猜如果你使用的是Cakphp 2.0或更高版本,你不能使用低於2的Debugkit版本,因爲它具有不同的插件名稱約定。文件具有不同的樹形結構。

因此,您只需使用較低版本並重命名文件或更新PHP或使用較低版本的Cakephp。