Skip to content

Commit d6cb711

Browse files
committed
feat:vega:readme
1 parent c15823c commit d6cb711

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

src/vega/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ $vega->handle('/html', function (Mix\Vega\Context $ctx) {
345345

346346
## 静态文件处理
347347

348-
基于 `sendfile` 零拷贝
348+
基于 `sendfile` 零拷贝,不支持在 `PHP-FPM` 中使用
349349

350350
```php
351351
$vega = new Mix\Vega\Engine();

src/vega/README_EN.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ composer require mix/vega
3333

3434
## Quick start
3535

36-
Swoole is used in multiple (asynchronous) processes
36+
- Swoole is used in multiple (asynchronous) processes
3737

3838
```php
3939
<?php
@@ -66,7 +66,7 @@ $http->set([
6666
]);
6767
```
6868

69-
Swoole is used in a single process (coroutine)
69+
- Swoole is used in a single process (coroutine)
7070

7171
```php
7272
<?php
@@ -84,7 +84,7 @@ Swoole\Coroutine\run(function () {
8484
});
8585
```
8686

87-
Used in the WorkerMan
87+
- Used in the WorkerMan
8888

8989
```php
9090
<?php
@@ -101,6 +101,19 @@ $http_worker->count = 4;
101101
Workerman\Worker::runAll();
102102
```
103103

104+
- Used in PHP-FPM
105+
106+
```php
107+
<?php
108+
require __DIR__ . '/vendor/autoload.php';
109+
110+
$vega = new Mix\Vega\Engine();
111+
$vega->handle('/hello', function (Mix\Vega\Context $ctx) {
112+
$ctx->string(200, 'hello, world!');
113+
})->methods('GET');
114+
$vega->run();
115+
```
116+
104117
Request to test
105118

106119
~~~
@@ -323,7 +336,7 @@ $vega->handle('/html', function (Mix\Vega\Context $ctx) {
323336

324337
## Static file handling
325338

326-
Based on `sendfile` zero copy
339+
Based on `sendfile` zero copy, not supported in `PHP-FPM`
327340

328341
```php
329342
$vega = new Mix\Vega\Engine();

0 commit comments

Comments
 (0)