CakePHP 2 无法使用 Debug_kit 找到 FireCake

发布于 2024-12-12 00:08:18 字数 976 浏览 0 评论 0原文

我一直在尝试使用 CakePHP 2.0,其中大部分工作得很好,但是我无法使用 FireCake 进行控制台日志记录。我在 Firefox 6.0.2 中安装了 FireBug 1.8.3 和 FirePHP 0.6.2,而我的旧 Cake 1.3 项目运行良好。对于 CakePHP 2.0,我下载了新版本的 DebugKit,将其放入插件中,将其添加到 Controllers 文件夹中的 AppController:

App::import('Vendor', 'DebugKit.FireCake');

class AppController extends Controller {

public $components = array('Cookie', 'DebugKit.Toolbar', 'RequestHandler', 'Session');

并将其添加到我的引导程序

CakePlugin::load('DebugKit');

和核心中

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

,然后将其放入我的控制器操作之一中,

FireCake::log($msg);

这会生成如下错误

Fatal error: Class 'FireCake' not found in C:\Users\foo\Documents\Websites\cakephp-2.0.0.35\numbering\Controller\AppController.php on line 29

:无法找出我可能从说明中遗漏的任何内容,那么有什么我可能忽略的明显的东西吗?或者需要一些额外的导入?任何帮助将不胜感激,谢谢。

Matt

[编辑]

我应该补充一点,DebugKit 菜单按预期显示并发挥作用,问题只是 FireCake。

I have been attempting to use CakePHP 2.0 and most of it works pretty well, however I have not been able to get console logging working with FireCake. I have FireBug 1.8.3 and FirePHP 0.6.2 installed in Firefox 6.0.2 and my old Cake 1.3 project works fine. For CakePHP 2.0 I downloaded the new version of DebugKit, put it in Plugins, added this to my AppController in Controllers folder:

App::import('Vendor', 'DebugKit.FireCake');

class AppController extends Controller {

public $components = array('Cookie', 'DebugKit.Toolbar', 'RequestHandler', 'Session');

and this in my bootstrap

CakePlugin::load('DebugKit');

and in core

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

and then put this in one of my controller actions

FireCake::log($msg);

which generates an error like this

Fatal error: Class 'FireCake' not found in C:\Users\foo\Documents\Websites\cakephp-2.0.0.35\numbering\Controller\AppController.php on line 29

I can't figure out anything I might have missed from the instructions, so is there something duh-obvious I might be overlooking? Or some extra import that is necessary? Any help would be appreciated, thanks.

Matt

[edit]

I should add that the DebugKit menu appears as expected and functions, the problem is just FireCake.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

太阳哥哥 2024-12-19 00:08:19

我相信如果您使用的是 CakePHP 2.2 或更高版本,您应该使用

App::uses('FireCake', 'DebugKit.Lib');

I believe you should use

App::uses('FireCake', 'DebugKit.Lib');

if you are on CakePHP 2.2 or higher.

调妓 2024-12-19 00:08:18

CakePHP v 2.0 的文档不正确。现在需要这样做:

App::import('Lib', 'DebugKit.FireCake');

The documentation was incorrect for CakePHP v 2.0. This is now required:

App::import('Lib', 'DebugKit.FireCake');
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文