我无法加载迁移插件。
CakePlugin::load('Migrations')
app/Plugin/Migrations
文件夹但我仍然遇到此错误,而我尝试运行迁移。
SPT@FI-JKL-D-18 /c/xampp/htdocs/Emailer/app (master)
$ /c/xampp/htdocs/Emailer/lib/Cake/Console/cake Migrations.migrate generate
Error: Plugin Migrate could not be found.
#0 C:\xampp\htdocs\Emailer\lib\Cake\Core\App.php(227): CakePlugin::path('Migrate')
#1 C:\xampp\htdocs\Emailer\lib\Cake\Core\App.php(549): App::path('Console/Command', 'Migrate')
#2 [internal function]: App::load('MigrateShell')
#3 [internal function]: spl_autoload_call('MigrateShell')
#4 C:\xampp\htdocs\Emailer\lib\Cake\Console\ShellDispatcher.php(257): class_exists('MigrateShell')
#5 C:\xampp\htdocs\Emailer\lib\Cake\Console\ShellDispatcher.php(203): ShellDispatcher->_getShell('Migrations.migr...')
#6 C:\xampp\htdocs\Emailer\lib\Cake\Console\ShellDispatcher.php(66): ShellDispatcher->dispatch()
#7 C:\xampp\htdocs\Emailer\lib\Cake\Console\cake.php(54): ShellDispatcher::run(Array)
#8 {main}
答案 0 :(得分:1)
我相信你的语法错了。
而不是
cake Migrations.migrate generate
尝试运行
cake Migrations.migration generate
答案 1 :(得分:0)
我正在使用CakePHP4。我也遇到过同样的问题。我已经解决了运行命令cake migrations migrate
的问题。它对我有用。