cake bake shell 脚本失败(在 cakephp2 => cakephp3 迁移之后)

cake bake shell script fails (after cakephp2 => cakephp3 migration)

我目前正在从 2 => 3 迁移应用程序。每当我 运行 cake/bake 我收到此错误:

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 有一些小的变化,需要替换它们。 (在此处获取它们 https://github.com/cakephp/app/tree/master/bin

编辑:cakephp 升级工具 (https://github.com/cakephp/upgrade) 有一个任务 (skeleton) 可以复制上述文件等。我还没有尝试过,但这似乎是解决问题的好方法。