Skip to content

Commit

Permalink
feat:vega:readme
Browse files Browse the repository at this point in the history
  • Loading branch information
onanying committed Jul 24, 2021
1 parent c15823c commit d6cb711
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/vega/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ $vega->handle('/html', function (Mix\Vega\Context $ctx) {

## 静态文件处理

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

```php
$vega = new Mix\Vega\Engine();
Expand Down
21 changes: 17 additions & 4 deletions src/vega/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ composer require mix/vega

## Quick start

Swoole is used in multiple (asynchronous) processes
- Swoole is used in multiple (asynchronous) processes

```php
<?php
Expand Down Expand Up @@ -66,7 +66,7 @@ $http->set([
]);
```

Swoole is used in a single process (coroutine)
- Swoole is used in a single process (coroutine)

```php
<?php
Expand All @@ -84,7 +84,7 @@ Swoole\Coroutine\run(function () {
});
```

Used in the WorkerMan
- Used in the WorkerMan

```php
<?php
Expand All @@ -101,6 +101,19 @@ $http_worker->count = 4;
Workerman\Worker::runAll();
```

- Used in PHP-FPM

```php
<?php
require __DIR__ . '/vendor/autoload.php';

$vega = new Mix\Vega\Engine();
$vega->handle('/hello', function (Mix\Vega\Context $ctx) {
$ctx->string(200, 'hello, world!');
})->methods('GET');
$vega->run();
```

Request to test

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

## Static file handling

Based on `sendfile` zero copy
Based on `sendfile` zero copy, not supported in `PHP-FPM`

```php
$vega = new Mix\Vega\Engine();
Expand Down

0 comments on commit d6cb711

Please sign in to comment.