generated from yiisoft/package-template
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Translation into Brazilian Portuguese and corrections to docs in Engl…
…ish (#81)
- Loading branch information
1 parent
9cc2518
commit 6bb8944
Showing
11 changed files
with
133 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Executor de aplicativo gRPC para RoadRunner | ||
|
||
Yii RoadRunner Runner suporta a execução de serviços [gRPC](https://grpc.io) através de `RoadRunnerGrpcApplicationRunner`. | ||
|
||
> Aviso! Para suporte ao PHP 8.2 use a extensão `grpc` >= 1.56.0 | ||
## Uso geral | ||
|
||
Por exemplo, vamos pegar o serviço `Pinger` descrito na [documentação](https://roadrunner.dev/docs/plugins-grpc) | ||
|
||
### DTO e geração de interface de serviço | ||
|
||
Uma descrição detalhada de como fazer isso pode ser lida em <https://roadrunner.dev/docs/plugins-grpc> | ||
|
||
### Criar trabalhador para gRPC | ||
|
||
Crie um arquivo handler no diretório do seu aplicativo, por exemplo `GrpcWorker.php`: | ||
|
||
```php | ||
use Yiisoft\Yii\Runner\RoadRunner\RoadRunnerGrpcApplicationRunner; | ||
|
||
ini_set('display_errors', 'stderr'); | ||
|
||
require_once dirname(__DIR__) . '/vendor/autoload.php'; | ||
|
||
$application = new RoadRunnerGrpcApplicationRunner( | ||
rootPath: __DIR__, | ||
debug: true | ||
); | ||
$application->setServices([ | ||
PingerInterface::class => Pinger::class, | ||
]) | ||
$application->run(); | ||
``` | ||
|
||
### Configurar RoadRunner | ||
|
||
Adicione o arquivo handler criado na seção `command` do arquivo de configuração `.rr.yaml` | ||
|
||
```yaml | ||
version: '3' | ||
|
||
server: | ||
command: "php GrpcWorker.php" | ||
``` | ||
|
||
ou para a seção `command` do plugin `grpc` se você suporta múltiplos handlers (por exemplo, `http` e `grpc`) | ||
|
||
```yaml | ||
version: '3' | ||
|
||
grpc: | ||
pool: | ||
command: "php GrpcWorker.php" | ||
``` | ||
|
||
> Aviso! Se você também estiver implementando o lado do cliente (para chamar a API RoadRunner do aplicativo PHP), você precisará adicionar manualmente o pacote `grpc/grpc` da versão correta ao seu composer.json. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Documentação do Yii RoadRunner Runner | ||
|
||
- [Executor de aplicativo gRPC para RoadRunner](grpc-application-runner.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Yii RoadRunner Runner | ||
|
||
- [English](en/readme.md) | ||
- [Português - Brasil](pt-BR/readme.md) | ||
- [Русский](ru/readme.md) | ||
- [Internals](../internals.md) |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Internals | ||
|
||
## Unit testing | ||
|
||
The package is tested with [PHPUnit](https://phpunit.de/). To run tests: | ||
|
||
```shell | ||
./vendor/bin/phpunit | ||
``` | ||
|
||
## Mutation testing | ||
|
||
The package tests are checked with [Infection](https://infection.github.io/) mutation framework with | ||
[Infection Static Analysis Plugin](https://github.com/Roave/infection-static-analysis-plugin). To run it: | ||
|
||
```shell | ||
./vendor/bin/roave-infection-static-analysis-plugin | ||
``` | ||
|
||
## Static analysis | ||
|
||
The code is statically analyzed with [Psalm](https://psalm.dev/). To run static analysis: | ||
|
||
```shell | ||
./vendor/bin/psalm | ||
``` | ||
|
||
## Rector | ||
|
||
Use [Rector](https://github.com/rectorphp/rector) to make codebase follow some specific rules or | ||
use either newest or any specific version of PHP: | ||
|
||
```shell | ||
./vendor/bin/rector | ||
``` | ||
|
||
## Composer require checker | ||
|
||
This package uses [composer-require-checker](https://github.com/maglnet/ComposerRequireChecker) to check if all dependencies are correctly defined in `composer.json`. | ||
|
||
To run the checker, execute the following command: | ||
|
||
```shell | ||
./vendor/bin/composer-require-checker | ||
``` |