hyperf/docs/zh-cn/devtool.md

49 lines
1.5 KiB
Markdown
Raw Normal View History

2019-05-24 15:44:28 +08:00
# 开发者工具
2019-05-16 20:18:43 +08:00
## 安装
```
composer require hyperf/devtool
2019-05-24 15:44:28 +08:00
```
2021-12-13 15:20:34 +08:00
## 支持的命令
2019-05-16 20:18:43 +08:00
2019-05-24 15:44:28 +08:00
```bash
2019-05-16 20:18:43 +08:00
php bin/hyperf.php
2019-05-24 15:44:28 +08:00
```
通过执行上面的命令可获得 Command 所支持的所有命令,其中返回结果 `gen` 系列命令和 `vendor:publish` 命令主要为 `devtool` 组件提供支持
2019-05-16 20:18:43 +08:00
```bash
2019-05-16 20:18:43 +08:00
gen
gen:amqp-consumer Create a new amqp consumer class
gen:amqp-producer Create a new amqp producer class
gen:aspect Create a new aspect class
gen:command Create a new command class
gen:controller Create a new controller class
gen:job Create a new job class
gen:listener Create a new listener class
gen:middleware Create a new middleware class
gen:process Create a new process class
vendor
vendor:publish Publish any publishable configs from vendor packages.
2019-11-06 17:45:30 +08:00
```
## 快速打开
2021-12-13 15:20:34 +08:00
增加了一个非常简单的功能,用内置的 `gen` 命令快速打开创建的文件,支持 `sublime`、`textmate`、`emacs`、`macvim`、`phpstorm`、`idea`、`vscode`、`vscode-insiders`、`vscode-remote`、`vscode-insiders-remote`、`atom`、`nova`、`netbeans`、`xdebug`。
还需要在 `config/autoload/devtool.php` 上添加这个配置块:
```php
return [
/**
* Supported IDEs: "sublime", "textmate", "emacs", "macvim", "phpstorm", "idea",
* "vscode", "vscode-insiders", "vscode-remote", "vscode-insiders-remote",
* "atom", "nova", "netbeans", "xdebug"
*/
'ide' => env('DEVTOOL_IDE', ''),
//...
];
```