CakePHP迁移:“模板”选项不存在

时间:2015-02-08 10:35:10

标签: php shell cakephp cakephp-3.0

执行

时出现以下错误
bin/cake migrations create Initial

错误:

  

[InvalidArgumentException]
    "模板"选项不存在。

插件已加载并正常工作。

//编辑:我在带有流浪汉的虚拟机上使用CakePHP 3.0 RC1全新安装 也许这个输出有帮助:



Exception trace:
 () at /var/www/projects/vendor/symfony/console/Symfony/Component/Console/Input/Input.php:180
 Symfony\Component\Console\Input\Input->getOption() at /var/www/projects/vendor/robmorgan/phinx/src/Phinx/Console/Command/Create.php:130
 Phinx\Console\Command\Create->execute() at /var/www/projects/vendor/cakephp/migrations/src/ConfigurationTrait.php:145
 Migrations\Command\Create->execute() at /var/www/projects/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:253
 Symfony\Component\Console\Command\Command->run() at /var/www/projects/vendor/symfony/console/Symfony/Component/Console/Application.php:874
 Symfony\Component\Console\Application->doRunCommand() at /var/www/projects/vendor/symfony/console/Symfony/Component/Console/Application.php:195
 Symfony\Component\Console\Application->doRun() at /var/www/projects/vendor/symfony/console/Symfony/Component/Console/Application.php:126
 Symfony\Component\Console\Application->run() at /var/www/projects/vendor/cakephp/migrations/src/Shell/MigrationsShell.php:70
 Migrations\Shell\MigrationsShell->main() at n/a:n/a
 call_user_func_array() at /var/www/projects/vendor/cakephp/cakephp/src/Console/Shell.php:387
 Cake\Console\Shell->runCommand() at /var/www/projects/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php:200
 Cake\Console\ShellDispatcher->_dispatch() at /var/www/projects/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php:171
 Cake\Console\ShellDispatcher->dispatch() at /var/www/projects/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php:122
 Cake\Console\ShellDispatcher::run() at /var/www/projects/bin/cake.php:20




我希望你能帮助我。

THX

1 个答案:

答案 0 :(得分:4)

我担心这是cakephp/migrations

中的错误

查看: /vendor/cakephp/migrations/src/Command/Create.php

configure()未调用其父级,因此不会考虑基础phinx库中的更改,即添加"模板"选项是这种情况下的问题。

IMO configure()应致电parent::configure()并将setName()setDescription()等电话留给phinx - 这里有一个问题{{3} }