Skip to content

Commit 9967574

Browse files
committed
docs: 更新示例项目 README
1 parent d0c30f2 commit 9967574

1 file changed

Lines changed: 31 additions & 27 deletions

File tree

README.md

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,47 @@
1-
# Introduction
1+
# HPlus App(测试示例项目)
22

3-
This is a skeleton application using the Hyperf framework. This application is meant to be used as a starting place for those looking to get their feet wet with Hyperf Framework.
3+
用于本地验证 HPlus 4.0 插件(route / validate / swagger)的示例项目。
44

5-
# Requirements
5+
## 环境要求
66

7-
Hyperf has some requirements for the system environment, it can only run under Linux and Mac environment, but due to the development of Docker virtualization technology, Docker for Windows can also be used as the running environment under Windows.
7+
- PHP ≥ 8.1
8+
- Hyperf ≥ 3.1
9+
- 扩展:swoole、json、mbstring、pcntl
810

9-
The various versions of Dockerfile have been prepared for you in the [hyperf/hyperf-docker](https://github.com/hyperf/hyperf-docker) project, or directly based on the already built [hyperf/hyperf](https://hub.docker.com/r/hyperf/hyperf) Image to run.
11+
## 依赖安装
1012

11-
When you don't want to use Docker as the basis for your running environment, you need to make sure that your operating environment meets the following requirements:
13+
```bash
14+
composer install
15+
```
1216

13-
- PHP >= 8.0
14-
- Any of the following network engines
15-
- Swoole PHP extension >= 4.5,with `swoole.use_shortname` set to `Off` in your `php.ini`
16-
- Swow PHP extension (Beta)
17-
- JSON PHP extension
18-
- Pcntl PHP extension
19-
- OpenSSL PHP extension (If you need to use the HTTPS)
20-
- PDO PHP extension (If you need to use the MySQL Client)
21-
- Redis PHP extension (If you need to use the Redis Client)
22-
- Protobuf PHP extension (If you need to use the gRPC Server or Client)
17+
## 运行
2318

24-
# Installation using Composer
19+
```bash
20+
php bin/hyperf.php start
21+
```
2522

26-
The easiest way to create a new Hyperf project is to use [Composer](https://getcomposer.org/). If you don't have it already installed, then please install as per [the documentation](https://getcomposer.org/download/).
23+
启动后访问:
24+
- 示例接口:`http://localhost:9501/test`
25+
- Swagger 文档(依赖 swagger 插件):`http://localhost:9501/swagger`
2726

28-
To create your new Hyperf project:
27+
## 相关插件版本
2928

30-
```bash
31-
$ composer create-project hyperf/hyperf-skeleton path/to/install
32-
```
29+
| 插件 | 版本 | 说明 |
30+
|------|------|------|
31+
| hyperf-plus/route | ^4.0 | 路由 4.0(kebab-case、静态路由优先) |
32+
| hyperf-plus/validate | ^4.0 | 验证 4.0(FormRequest、Query/Body 分离) |
33+
| hyperf-plus/swagger | ^4.0 | Swagger 4.0(懒加载+缓存,OpenAPI 3.1.1) |
3334

34-
Once installed, you can run the server immediately using the command below.
35+
## 常用命令
3536

3637
```bash
37-
$ cd path/to/install
38-
$ php bin/hyperf.php start
38+
# 启动服务
39+
php bin/hyperf.php start
40+
41+
# 运行测试
42+
composer test
3943
```
4044

41-
This will start the cli-server on port `9501`, and bind it to all network interfaces. You can then visit the site at `http://localhost:9501/`
45+
## 注意
4246

43-
which will bring up Hyperf default home page.
47+
本项目仅用于 4.0 功能验证,不建议直接用于生产。

0 commit comments

Comments
 (0)