marionnewlevant / exec-widget
运行调用 exec(...) 的任务的 Widgets
1.0.0
2018-02-14 00:29 UTC
Requires
- craftcms/cms: ^3.0.0-RC1
This package is auto-updated.
Last update: 2024-09-05 19:14:47 UTC
README
运行调用 exec(...) 的任务的 Widgets
要求
此插件需要 Craft CMS 3.0.0-beta.23 或更高版本。
安装
- 通过在项目目录下执行
composer require marionnewlevant/exec-widget
使用 Composer 安装 - 在 Craft 控制面板的设置 > 插件中安装插件
或者
- 通过插件商店安装
Exec Widget 概述
运行任务中 php exec 的仪表板小部件。
配置 Exec Widget
您需要一个配置文件,config/execWidget.php
。该文件定义了可以运行的不同命令。
示例配置文件(注意,常规的多环境配置也适用于此处)
<?php
return [
'commands' => [
// each command has the name it will be displayed with
// and the command line
'Do the Thing' => './bin/doTheThing.sh --quiet',
'Another Thing' => './bin/somethingElse.sh',
]
];
使用 Exec Widget
将小部件添加到仪表板,并使用说明和选择命令进行配置。点击“执行”按钮将启动一个任务来运行命令。命令输出将被捕获在 queue.log
日志中。搜索 ExecWidget Task
以找到输出。
由 Marion Newlevant 提供。图标由 B Barrett from the Noun Project 设计。