没有提示的 cakephp 控制台(-f 选项?)
cakephp console without prompt (-f option?)
一些CakeConsole命令(如schema update
)需要用户确认操作。 (Are you sure…
封邮件)
想在Puppet下使用(自动安装)所以没有实际用户输入yes
确认
是否有任何选项可以强制控制台执行此操作?不询问用户?
有一个选项
--yes, -y Do not prompt for confirmation. Be careful!
-> app/Console/cake schema update --help
Welcome to CakePHP v2.8.0-dev Console
---------------------------------------------------------------
App : app
Path: /var/www/someapp.dev/
---------------------------------------------------------------
Usage:
cake schema update [options]
Options:
--help, -h Display this help.
--verbose, -v Enable verbose output.
--quiet, -q Enable quiet output.
--plugin, -p The plugin to use.
--path Path to read and write schema.php (default:
/var/www/someapp.dev/app/Config/Schema)
--file File name to read and write.
--name Classname to use. If its Plugin.class, both name and
plugin options will be set.
--connection, -c Set the db config to use. (default:
default)
--dry Perform a dry run on create and update commands.
Queries will be output instead of run.
--snapshot, -s Snapshot number to use/make.
--force, -f Force "generate" to create a new schema
--yes, -y Do not prompt for confirmation. Be careful!
但是未添加 yes
选项 until 2.5 - 如果您使用的是 2.x 的早期版本,您您需要升级才能使用此选项。
一些CakeConsole命令(如schema update
)需要用户确认操作。 (Are you sure…
封邮件)
想在Puppet下使用(自动安装)所以没有实际用户输入yes
确认
是否有任何选项可以强制控制台执行此操作?不询问用户?
有一个选项
--yes, -y Do not prompt for confirmation. Be careful!
-> app/Console/cake schema update --help
Welcome to CakePHP v2.8.0-dev Console
---------------------------------------------------------------
App : app
Path: /var/www/someapp.dev/
---------------------------------------------------------------
Usage:
cake schema update [options]
Options:
--help, -h Display this help.
--verbose, -v Enable verbose output.
--quiet, -q Enable quiet output.
--plugin, -p The plugin to use.
--path Path to read and write schema.php (default:
/var/www/someapp.dev/app/Config/Schema)
--file File name to read and write.
--name Classname to use. If its Plugin.class, both name and
plugin options will be set.
--connection, -c Set the db config to use. (default:
default)
--dry Perform a dry run on create and update commands.
Queries will be output instead of run.
--snapshot, -s Snapshot number to use/make.
--force, -f Force "generate" to create a new schema
--yes, -y Do not prompt for confirmation. Be careful!
但是未添加 yes
选项 until 2.5 - 如果您使用的是 2.x 的早期版本,您您需要升级才能使用此选项。