标签:
转载:https://yplam.com/post/79
Drupal Console 是面向Drupal 8 的一套命令行工具,用来生成Drupal 8模板代码,并且可以跟Drupal 8应用进行交互。
Drupal Console 与大家熟知的Drush有点类似,但提供不一样的功能,它可以跟Drush结合使用。
$ curl -LSs http://drupalconsole.com/installer | php
windows下:
php -r "readfile(‘http://drupalconsole.com/installer‘);" | php
当然,你也可以将它移到系统的PATH路径,然后更名为drupal命令
$ mv console.phar /usr/local/bin/drupal
去到一个Drupal的安装目录里,运行
drupal list
它会列出当前可用的命令及简介。如果你以前使用过Symfony的话,会感觉很熟悉。
Drupal Console version 0.9.3
Usage:
command [options] [arguments]
Options:
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
--root[=ROOT] application.console.arguments.root
-s, --shell Launch the shell.
-e, --env[=ENV] The Environment name. [default: "prod"]
--no-debug Switches off debug mode.
--learning Generate a verbose code output.
-t, --target[=TARGET] application.console.arguments.target
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
-gc, --generate-chain Print execution options and arguments as yaml output to be used in chain command
-gi, --generate-inline Print execution options and arguments as inline call to be use in the future
-gd, --generate-doc application.console.arguments.generate-doc
Available commands:
_completion BASH completion hook.
about Display basic information about Drupal Console project
chain Chain command execution
complete commands.complete.description
drush Run drush from console.
help Displays help for a command
init Copy configuration files to user home directory.
list Lists commands
self-update Update the console to latest version.
cache
cache:rebuild Rebuild and clear all site caches.
config
config:debug Show the current configuration.
config:edit Edit the selected configuration.
config:export Export current application configuration.
config:export:content:type Export a specific content type and their fields.
config:export:single Export single configuration as yml file.
config:export:view Export a view in YAML format inside a provided module to reuse in other website.
config:import Import configuration to current application.
config:import:single Import the selected configuration.
config:override Override config value in active configuration.
container
container:debug Displays current services for an application.
cron
cron:debug List of modules implementing a cron
cron:execute Execute cron implementations by module or execute all crons
cron:release Release cron system lock to run cron again
dblog
dblog:clear Remove events from DBLog table, filters are available
dblog:debug Display current log events for the application
generate
generate:authentication:provider Generate an Authentication Provider
generate:command Generate commands for the console.
generate:controller Generate & Register a controller
generate:doc commands.generate.doc.description
generate:entity:bundle Generate a new content type (node / entity bundle)
generate:entity:config commands.generate.entity.description
generate:entity:content commands.generate.entity.description
generate:event:subscriber Generate an event subscriber
generate:form:alter Generate an implementation of hook_form_alter() or hook_form_FORM_ID_alter
generate:form:config Generate a new "ConfigFormBase"
generate:module Generate a module.
generate:permissions Generate module permissions
generate:plugin:block Generate a plugin block
generate:plugin:condition Generate a plugin condition.
generate:plugin:field Generate field type, widget and formatter plugins.
generate:plugin:fieldformatter Generate field formatter plugin.
generate:plugin:fieldtype Generate field type plugin.
generate:plugin:fieldwidget Generate field widget plugin.
generate:plugin:imageeffect Generate image effect plugin.
generate:plugin:imageformatter Generate image formatter plugin.
generate:plugin:rest:resource Generate plugin rest resource
generate:plugin:rulesaction Generate a plugin rule action
generate:plugin:type:annotation Generate a plugin type with annotation discovery
generate:plugin:type:yaml Generate a plugin type with Yaml discovery
generate:plugin:views:field Generate a custom plugin view field.
generate:service Generate service
generate:theme Generate a theme.
migrate
migrate:debug Display current migration available for the application
migrate:execute Execute a migration available for application
migrate:load Generate a migration entity.
module
module:debug Display current modules available for application
module:download Install module or modules in the application
module:install Install module or modules in the application
module:uninstall Install module or modules in the application
rest
rest:debug Display current rest resource for the application
rest:disable Disable a rest resource for the application
rest:enable Enable a rest resource for the application
router
router:debug Displays current routes for the application
router:rebuild Rebuild routes for the application
site
site:debug List all known local and remote sites.
site:install Install a Drupal project
site:maintenance Switch site into maintenance mode
site:mode Switch system performance configuration
site:new Create a new Drupal project
site:status View current Drupal Installation status
test
test:debug List Test Units available for the application.
test:run Run Test unit