2013-06-05 52 views
0

當我試圖烘烤某些視圖和控制器時,我似乎得到了神祕錯誤。該模型出爐的好(一用一類似的消息建築物測試去世),和所有的控制器出爐行吧一個與以下錯誤消息:蛋糕烘烤「`流`不是一個ConsoleOutput也不是字符串」錯誤

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)

謝謝

回答

0

啊。 CakePHP 2是垃圾.. CakePHP 1.3好多了,似乎可以工作,並且不會在文件夾結構上使用愚蠢的大寫字母。

+0

不同意 - 2x是很快/更好的一切,所有內容都被延遲加載,現在所有文件名都與它們的對象匹配,並且切換到例外是一種更好的策略,允許更多的選項/靈活性。 – zeroasterisk

0

我遇到了同樣的問題,花了2個小時來調試它。你似乎犯了同樣的錯誤。

CakePHP 2的模型構造通過調用\ReflectionClass來調用其模型實例。但是,CakePHP 2不使用名稱空間。

這裏發生了以下情況: CakePHP 2在/lib/Cake/Console/Command/Task/ProjectTask.php中已經有一個名爲ProjectTask的類。您將Projecttask命名爲Projecttask,因此當ReflectionClass嘗試調用Projecttask模型時,它意外地調用了Cake的內部ProjectTask shell任務,該任務需要一個流參數,但取而代之的是您的模型的classalias參數。

因此,基本上,您的Projecttask模型重命名爲其他東西。 另外,命名空間非常棒。

相關問題