我正在尝试使用蛋糕烘焙来搭建我的项目,但是当它生成视图时,我会收到此错误消息:
Warning Error: dirname() expects parameter 1 to be string, array given in [/Applications/MAMP/htdocs/apeppers/romeo2/lib/Cake/Utility/File.php, line 89]
Warning Error: is_dir() expects parameter 1 to be a valid path, array given in [/Applications/MAMP/htdocs/apeppers/romeo2/lib/Cake/Utility/File.php, line 90]
Warning Error: basename() expects parameter 1 to be string, array given in [/Applications/MAMP/htdocs/apeppers/romeo2/lib/Cake/Utility/File.php, line 91]
Notice Error: Undefined property: File::$table in [/Applications/MAMP/htdocs/apeppers/romeo2/lib/Cake/Model/Model.php, line 1054]
Notice Error: Undefined property: File::$primaryKey in [/Applications/MAMP/htdocs/apeppers/romeo2/lib/Cake/Console/Command/Task/ViewTask.php, line 464]
Notice Error: Undefined property: File::$displayField in [/Applications/MAMP/htdocs/apeppers/romeo2/lib/Cake/Console/Command/Task/ViewTask.php, line 465]
Fatal error: Call to undefined method File::schema() in /Applications/MAMP/htdocs/apeppers/romeo2/lib/Cake/Console/Command/Task/ViewTask.php on line 468
Fatal Error Error: Call to undefined method File::schema() in [/Applications/MAMP/htdocs/apeppers/romeo2/lib/Cake/Console/Command/Task/ViewTask.php, line 468]
在此之前,我的数据库连接有一些错误,我在MAMP mysql bin中使用sudo ln -s
解决了库mysql bin。
答案 0 :(得分:1)
在CakePHP中,由于某种原因与cake的File.php模块发生冲突,你无法烘焙名为files
的表。
答案 1 :(得分:0)
如果其他人遇到了同样的问题,我必须做些什么才能让错误消失:
我还删除了所有已生成的旧文件,包括在app \ Test目录中。我不知道这是否必要,但我希望一切尽可能干净。