Skip to content
This repository has been archived by the owner on Sep 12, 2019. It is now read-only.

Latest commit

 

History

History
242 lines (238 loc) · 14.7 KB

available-commands.md

File metadata and controls

242 lines (238 loc) · 14.7 KB

可用的 Drupal Console 命令

备注: Drupal Console 命令必须从 Drupal 8 网站的根目录运行.

Drupal Console 命令 详细信息
misc
about 显示有关 Drupal Console 项目的基本信息
chain 链命令执行
check 系统需求检查器
composerize Converts Drupal codebase to composer.
exec 执行一个外部命令
help 显示帮助
init 拷贝配置文件到用户的 home 目录
list 列出当前可用命令
shell 打开一个提供交互式REPL(Read–Eval–Print-Loop) shell.
server 运行PHP内建的网站服务器
cache
cache:rebuild 重建和清除所有网站缓存。
cache:tag:invalidate Invalidate cache tags.
config
config:delete 删除配置
config:diff 比对目录,输出与活动配置不同的配置项。
config:edit 使用文本编辑器更改配置对象。
config:export 导出当前应用配置。
config:export:content:type 导出特定的内容类型及其字段。
config:export:single 将单个配置或一系列配置导出为 yml 文件。
config:export:view 在提供的模块中导出 YAML 格式的视图,以便在其他网站中重复使用。
config:import 将配置导入当前应用程序。
config:import:single 导入单个配置或一系列配置。
config:override 覆盖活动配置中的配置值。
config:validate 根据其 Schema 验证 drupal 配置
config_update
config_update:default commands.config_update.default.description
create
create:comments 为您的 Drupal 8 应用程序创建评论。
create:nodes 为您的 Drupal 8 应用程序创建节点。
create:roles Create dummy roles for your Drupal 8 application.
create:terms 为您的 Drupal 8 应用程序创建术语。
create:users 为您的 Drupal 8 应用程序创建用户。
create:vocabularies 为您的 Drupal 8 应用程序创建词汇表。
cron
cron:execute 执行模块实现的计划任务或执行所有计划任务
cron:release 释放定时任务系统锁,再次重新运行定时任务
database
database:add 添加数据库到 settings.php
database:client 启动数据库客户端(如果可用)
database:connect 显示 DB 连接
database:drop 删除给定数据库中的所有表。
database:dump 转储数据库结构和内容
database:log:clear 从 DBLog 表中删除事件,过滤器可用
database:log:poll 轮询看门狗并每 x 秒打印一次新的日志条目
database:query 直接作为参数执行 SQL 语句
database:restore 还原数据库结构和内容。
debug
debug:breakpoints 显示应用程序中可用的断点
debug:cache:context 显示应用程序的当前缓存上下文。
debug:chain 列出可用的链命令文件。
debug:config 列出配置对象名称和单个配置对象。
debug:config:settings 显示当前设置文件的键值对。
debug:config:validate 在安装模块之前验证 schema 实现。
debug:container 显示应用程序的当前服务。
debug:cron 实现计划任务的模块列表
debug:database:log 显示应用程序的当前日志事件
debug:database:table 显示给定数据库中的所有表。
debug:entity 调试系统中可用的实体
debug:event 显示当前事件
debug:features 列出注册的功能。
debug:image:styles 列出网站上的图片样式
debug:libraries 显示应用程序中可用的库
debug:migrate 显示可用于应用程序的当前迁移
debug:module 显示可用于应用的当前模块
debug:multisite 列出系统中可用的所有多站点
debug:permission 显示所有用户权限。
debug:plugin 显示所有插件类型。
debug:queue 显示应用中的队列(s)
debug:rest 显示应用程序的当前 REST 资源
debug:roles Displays current roles for the application
debug:router 显示应用程序的当前路由或特定路由的信息
debug:settings 列出用户的 Drupal Console 设置。
debug:site 列出所有已知的本地和远程站点。
debug:state 显示当前的状态键。
debug:test 列出可用于应用程序的测试单元。
debug:theme 显示应用程序的当前主题
debug:theme:keys Displays all theme keys provided by hook_theme functions
debug:update 显示可用于应用程序的当前更新
debug:user 显示应用程序的当前用户
debug:views 显示应用程序的当前视图资源
debug:views:plugins 显示应用程序的当前视图插件
devel
devel:dumper commands.devel.dumper.messages.change-devel-dumper-plugin
docker
docker:init Create a docker-compose.yml file
dotenv
dotenv:debug Debug Dotenv debug values.
dotenv:init Dotenv initializer.
entity
entity:delete Delete an specific entity
features
features:import 导入模块配置
field
field:info View information about fields.
generate
generate:ajax:command Generate & Register a custom ajax command
generate:authentication:provider 生成认证提供者
generate:breakpoint 生成断点
generate:cache:context Generate a cache context
generate:command 生成新 Console 命令
generate:controller 生成并注册新控制器
generate:entity:bundle 生成新内容类型(node 或实体 bundle)
generate:entity:config 生成新配置实体
generate:entity:content 生成新内容实体
generate:event:subscriber 生成事件订阅者
generate:form Generate a new "FormBase"
generate:form:alter 生成 hook_form_alter() 或 hook_form_FORM_ID_alter 实现
generate:form:config Generate a new "ConfigFormBase"
generate:help 生成 hook_help() 的一个实现
generate:jstest Generate a JavaScript test.
generate:module 生成新模块
generate:module:file 生成一个 .module 文件
generate:permissions Generate module permissions
generate:plugin:block 生成区块插件
generate:plugin:ckeditorbutton 生成 CKEditor 按钮插件
generate:plugin:condition 生成条件插件
generate:plugin:field 生成字段类型、Widget和格式化器的插件
generate:plugin:fieldformatter 生成字段格式化器插件
generate:plugin:fieldtype 生成字段类型插件
generate:plugin:fieldwidget 生成字段 Widget 插件
generate:plugin:imageeffect 生成图像效果插件
generate:plugin:imageformatter 生成图像显示插件.
generate:plugin:mail 生成 mail 插件
generate:plugin:migrate:process Generate a migrate process plugin
generate:plugin:migrate:source Generate a migrate source plugin
generate:plugin:rest:resource 生成 REST资源插件
generate:plugin:rulesaction 生成一个规则(Rule)行为(action)插件
generate:plugin:skeleton 为没有特定生成器的生成一个基本插件的实现
generate:plugin:type:annotation 生成一个有识别注解能力的插件类别
generate:plugin:type:yaml 生成一个有识别Yaml能力的插件类别
generate:plugin:views:field 生成一个定制的插件视窗域.
generate:post:update 生成一个 hook_post_update_NAME() 的实现
generate:profile 生成一个方案.
generate:routesubscriber 生成一个路径订阅
generate:service 生成服务
generate:site:alias Generates a site alias.
generate:theme 生成一个外观主题.
generate:twig:extension 生成一个 Twig 扩展
generate:update 生成一个 hook_update_N() 的实现
image
image:styles:flush 按图像样式执行 flush 函数或对所有图像样式执行 flush 函数
locale
locale:language:add 添加一种语言
locale:language:delete 删除一种语言
locale:translation:status 列出可用翻译更新
migrate
migrate:execute 执行可用迁移
migrate:rollback 回滚一个或多个迁移
migrate:setup 导入或创建数据库迁移
module
module:dependency:install 在应用中安装依赖模块
module:download 下载模块
module:install 安装模块
module:path 返回模块的相对路径(或绝对路径)
module:uninstall 卸载模块
module:update 更新核心,模块
multisite
multisite:new 建立一个新的多站点安装文件(s)
multisite:update Update the files for a multisite installed.
node
node:access:rebuild 创建节点访问权限. 重建会移除所有内容上的使用权限并替换为当前模块或当前设置里的权限
queue
queue:run 处理选中的队列
rest
rest:disable 禁用 REST 资源
rest:enable 启用 REST 资源
role
role:delete Delete roles for the application
role:new Create roles for the application
router
router:rebuild 重建路由
sample
sample:default commands.sample.default.description
settings
settings:set 改变 DrupalConsole 配置文件中的配置
site
site:import:local 导入/配置一个已经存在的 Drupal 项目
site:install 安装 Drupal
site:maintenance 切换网站到维护模式
site:mode 转换系统性能配置
site:statistics 显示网站的当前统计
site:status 当前Drupal安装状态
state
state:delete 删除状态
state:override 覆写状态键的值
taxonomy
taxonomy:term:delete Delete taxonomy terms from a vocabulary
test
test:run 运行这个程序有的测试单元
theme
theme:download 下载主题
theme:install 安装主题
theme:path 返回主题的相对路径 (或绝对路径)
theme:uninstall 卸载程序的一个或多个外观主题
update
update:entities 应用实体更新
update:execute 执行的给出的某个模块的更新程序或者执行所有的更新程序
user
user:create Create users for the application
user:delete 删除网站用户(s)
user:login:clear:attempts 清空一个用户的登录尝试数据。
user:login:url 返回一次性登录链接.
user:password:hash 从文本格式密码中生成哈希码
user:password:reset 为指定用户重设密码.
user:role 添加/移除给定用户的角色
views
views:disable 停启视图
views:enable 启用一个视图

可用选项

选项 详细信息
--help 显示此帮助消息
--quiet 禁止命令中的所有输出
--verbose 增加消息的冗长度:正常输出为1,更详细输出为2,调试为3
--version 显示此应用程序版本
--ansi 强制 ANSI 输出
--no-ansi 禁用 ANSI 输出
--no-interaction 不要问任何互动的问题
--env 环境名称
--root 定义要在命令执行中使用的 Drupal 根目录
--debug Switches on debug mode
--learning 生成一个详细的代码输出
--generate-chain 将命令选项和参数显示为在 chain 命令中使用的 yaml 输出
--generate-inline 将显示命令选项和参数作为 inline 命令
--generate-doc 将命令选项和参数显示为 markdown
--target 您要与之交互的网站名称(适用于本地或远程站点)
--uri 要使用的 Drupal 站点的 URI(对于多站点环境或在备用端口上运行时)
--yes 跳过确认并继续

可用参数

参数 详细信息
command 待执行的命令