namespace Admin\Shell;
use Cake\Console\Shell;
class AdminAlertShell extends Shell{
...
...
}
这里'Admin'是插件,所以我在插件文件夹结构中创建了这个文件。文件路径:/plugins/Admin/src/Shell/AdminAlertShell.php
试图在 CLI 中运行它
bin/cake admin_alert
但是抛出异常
例外:未知命令cake admin_alert
。运行cake --help
以获取有效命令的列表。在 [localpath/vendor/cakephp/cakephp/src/Console/CommandRunner.php,第 346 行]
它正在工作。但我不知道这是怎么回事。我已将 cakephp 3.5 升级到 3.7。但是,我不确定这是否会导致问题。