Cake烘焙“`stream`而不是ConsoleOutput也不是字符串”错误

时间:2013-06-05 07:23:58

标签: cakephp cakephp-bake

当我试图烘焙某些视图和控制器时,我似乎得到了神秘的错误。烤好的模型(一个死于类似的消息构建测试),并且所有控制器都可以正常使用以下错误消息:

Error: `stream` not a ConsoleOutput nor string
#0 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Log/LogEngineCollection.php(43): ConsoleLog->__construct(Array)
#1 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Log/CakeLog.php(199): LogEngineCollection->load('stdout', Array)
#2 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Shell.php(841): CakeLog::config('stdout', Array)
#3 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Shell.php(176): Shell->_useLogger()
#4 [internal function]: Shell->__construct(Array)
#5 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Utility/ClassRegistry.php(168): ReflectionClass->newInstance(Array)
#6 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Model/Model.php(1032): ClassRegistry::init(Array)
#7 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Model/Model.php(858): Model->_constructLinkedModel('Projecttask', 'Projecttask', NULL)
#8 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Model/Model.php(888): Model->__isset('Projecttask')
#9 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/Task/ViewTask.php(459): Model->__get('Projecttask')
#10 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/Task/ViewTask.php(285): ViewTask->_associations(Object(Project))
#11 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/Task/ViewTask.php(224): ViewTask->_loadController()
#12 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/Task/ViewTask.php(91): ViewTask->_interactive()
#13 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(111): ViewTask->execute()
#14 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#15 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#16 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#17 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#18 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#19 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#20 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#21 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#22 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#23 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#24 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#25 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#26 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#27 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#28 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#29 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#30 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#31 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#32 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#33 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#34 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#35 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#36 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#37 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#38 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#39 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#40 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#41 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#42 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#43 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#44 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(132): BakeShell->main()
#45 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Shell.php(392): BakeShell->main()
#46 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/ShellDispatcher.php(200): Shell->runCommand(NULL, Array)
#47 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/ShellDispatcher.php(68): ShellDispatcher->dispatch()
#48 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/cake.php(50): ShellDispatcher::run(Array)
#49 {main}

当我为之前出炉的模型和控制器烘焙视图时,我得到:

Error: `stream` not a ConsoleOutput nor string
#0 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Log/LogEngineCollection.php(43): ConsoleLog->__construct(Array)
#1 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Log/CakeLog.php(199): LogEngineCollection->load('stdout', Array)
#2 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Shell.php(841): CakeLog::config('stdout', Array)
#3 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Shell.php(176): Shell->_useLogger()
#4 [internal function]: Shell->__construct(Array)
#5 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Utility/ClassRegistry.php(168): ReflectionClass->newInstance(Array)
#6 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Model/Model.php(1032): ClassRegistry::init(Array)
#7 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Model/Model.php(858): Model->_constructLinkedModel('Projecttask', 'Projecttask', NULL)
#8 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Model/Model.php(888): Model->__isset('Projecttask')
#9 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/Task/ViewTask.php(459): Model->__get('Projecttask')
#10 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/Task/ViewTask.php(285): ViewTask->_associations(Object(Projecttasknote))
#11 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/Task/ViewTask.php(224): ViewTask->_loadController()
#12 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/Task/ViewTask.php(91): ViewTask->_interactive()
#13 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Command/BakeShell.php(111): ViewTask->execute()
#14 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/Shell.php(392): BakeShell->main()
#15 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/ShellDispatcher.php(200): Shell->runCommand(NULL, Array)
#16 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/ShellDispatcher.php(68): ShellDispatcher->dispatch()
#17 /var/www/vhosts/raccoon/cakephp-cakephp-f02bc38/lib/Cake/Console/cake.php(50): ShellDispatcher::run(Array)
#18 {main}

它非常神秘,如果有人能告诉我在哪里看,那就太好了。我正在使用最新最好的蛋糕(2.3.5)

由于

2 个答案:

答案 0 :(得分:0)

阿。 CakePHP 2是垃圾.. CakePHP 1.3好多了,似乎工作,并没有在文件夹结构上使用愚蠢的大写字母。

答案 1 :(得分:0)

我遇到了同样的问题并花了2个小时进行调试。你似乎犯了我犯的完全相同的错误。

CakePHP 2的模型构建通过\ReflectionClass调用其模型实例。但是,CakePHP 2不使用名称空间。

这里发生的事情如下: CakePHP 2在ProjectTask中已经有一个名为/lib/Cake/Console/Command/Task/ProjectTask.php的类。您将其中一个模型命名为Projecttask,因此当ReflectionClass尝试调用您的Projecttask模型时,它会意外调用Cake的内部ProjectTask shell任务,该任务需要一个流参数,而是获取模型的classalias参数。

基本上,将您的Projecttask模型重命名为其他内容。 此外,名称空间很棒。