2014-02-09 47 views
2

我很难得到配置CakePHP的DebugKit。我已经阅读了这里的答案:How to Install DebugKit on CakePHP但它似乎没有帮助。安装CakePHP DebugKit

这是我迄今所做的:

创建的应用/插件目录名为DebugKit

从SVN下载的所有文件(它们有一个文件夹,名为debug_kit但我只是复制一切文件并将它们放在我新创建的DebugKit文件夹中)

取消注释行CakePlugin :: load('DebugKit'); //加载在bootstrap.php中

名为DebugKit一个插件

我的AppController类现在看起来是这样

class AppController extends Controller { 

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

} 

我core.php中有这样一行:

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

而且我注释掉此行在文件default.ctp

<!-- <?php //echo $this->element('sql_dump'); ?> --> 

我收到的错误消息是:

Error: The application is trying to load a file from the DebugKit plugin

Error: Make sure your plugin DebugKit is in the app\Plugin directory and was loaded

我一直URL重写启用按照下列指示:http://book.cakephp.org/2.0/en/installation/url-rewriting.html#apache-and-mod-rewrite-and-htaccess

我的Web应用程序的目录结构是这样的: WAMP/WWW/CakePHP的/

我也注意到,有一个名为plugins的文件夹在这个位置: cakephp/plugins - 我试图将下载的插件复制到该位置,但它也不起作用。

任何建议将不胜感激。

大号

+0

如果您正在使用cakephp2 .x,你需要在bootstrap.php文件中手动加载插件。 CakePlugin :: loadAll(); //加载所有插件 CakePlugin :: load('DebugKit'); //加载一个插件 – Garry

+0

感谢您的回复 - 但我已经在bootstrap.php文件中配置了它。我已经尝试加载一个插件,并使用loadAll()。 –

+0

您也可以删除缓存文件,只是为了确保 – cornelb

回答

2

这是我的一个非常愚蠢的错误 - 我刚刚注释掉行CakePlugin ::负载(“DebugKit”);在bootstrap.php文件中,但它仍然被一个注释块包围,所以取消注释该行不起作用。傻我。

0

确保目录的名称,其中debugkit所在

正确的名称是DebugKit

应用/插件/ DebugKit

2

如果您正在使用cakephp2.x,你需要加载插件在cake/app/config/bootstrap.php文件中。

,你会发现线条看起来像

*CakePlugin::loadAll(); // Loads all plugins at once *CakePlugin::load(’DebugKit’); //Loads a single plugin 

,那么你必须复制粘贴代码,而不带*符号

CakePlugin::loadAll(); // Loads all plugins at once CakePlugin::load(’DebugKit’); //Loads a single plugin 

这对我的作品