Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/shell/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Shell 蛋糕烘焙外壳脚本失败(在cakephp2=>;cakephp3迁移之后)_Shell_Cakephp_Cakephp 3.0 - Fatal编程技术网

Shell 蛋糕烘焙外壳脚本失败(在cakephp2=>;cakephp3迁移之后)

Shell 蛋糕烘焙外壳脚本失败(在cakephp2=>;cakephp3迁移之后),shell,cakephp,cakephp-3.0,Shell,Cakephp,Cakephp 3.0,我目前正在从2=>3迁移应用程序。每当我运行“蛋糕/烘焙”时,都会出现以下错误: Exception: Shell class for "-working" could not be found. in [/Users/david/Sites/otherland/app/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php, line 328] 当我查看提供给ShellDispatcher的参数时,我看到: Array ( [0]

我目前正在从2=>3迁移应用程序。每当我运行“蛋糕/烘焙”时,都会出现以下错误:

Exception: Shell class for "-working" could not be found. in [/Users/david/Sites/otherland/app/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php, line 328]
当我查看提供给ShellDispatcher的参数时,我看到:

Array
(
    [0] => /Users/david/Sites/otherland/app/bin/cake.php
    [1] => -working
    [2] => /Users/david/Sites/otherland/app
    [3] => bake
)

显然,索引为1的参数就是问题所在。我没有在shell中主动输入“-working”。我不知道这可能来自哪里。有人知道这可能来自哪里吗?问题是我没有替换文件
app/bin/cake
(对于windows用户,应该是
app/bin/cake.bat
)。从蛋糕2到蛋糕3,这些文件中有一些小的变化,需要更换。(把他们带到这里)


编辑:cakephp升级工具()有一个任务(
skeleton
),用于复制上述文件和其他文件。我还没有尝试过,但这似乎是解决这个问题的一个好方法。

我建议您使用composer生成cake 3项目,烘焙生成新模型,然后手动将代码从cake 2项目转移过来。这允许您从自由单元测试开始,您可以使用这些测试在运行时验证功能。这需要更长的时间是的,但最终会得到更好的结果。@MathewFoscarini这当然是一种方法,但我选择使用3.x升级工具,而您必须手动替换提到的文件。我实际上忘记了有升级工具。如果这是工具遗漏的内容。你应该在GitHub项目上打开一个问题来提醒团队,因为这听起来像是它应该做的事情。有一个复制上述文件的任务—骨架任务。我的错误似乎是我没有执行那个任务。我会及时更新我的答案。