CakePHP 2 无法使用 Debug_kit 找到 FireCake
我一直在尝试使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我相信如果您使用的是 CakePHP 2.2 或更高版本,您应该使用
。
I believe you should use
if you are on CakePHP 2.2 or higher.
CakePHP v 2.0 的文档不正确。现在需要这样做:
The documentation was incorrect for CakePHP v 2.0. This is now required: