0

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

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

我无法弄清楚我可能从说明中遗漏了什么,所以我可能忽略了一些明显的东西吗?或者一些额外的进口是必要的?任何帮助将不胜感激,谢谢。

马特

[编辑]

我应该补充一点,DebugKit 菜单按预期显示并且功能正常,问题只是 FireCake。

4

2 回答 2

1

我相信你应该使用

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

如果您使用的是 CakePHP 2.2 或更高版本。

于 2013-12-22T23:05:09.743 回答
1

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

App::import('Lib', 'DebugKit.FireCake');
于 2011-11-03T18:09:53.553 回答