Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/swoole-nyholm/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Swoole Runtime with nyholm/psr7

A runtime for [Swoole](https://www.swoole.co.uk/).
A runtime for [Swoole](https://www.swoole.com/).

If you are new to the Symfony Runtime component, read more in the [main readme](https://github.com/php-runtime/runtime).

Expand All @@ -26,7 +26,7 @@ APP_RUNTIME=Runtime\SwooleNyholm\Runtime
use Swoole\Http\Request;
use Swoole\Http\Response;

require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
require_once dirname(__DIR__) . '/vendor/autoload_runtime.php';

return function () {
return function (Request $request, Response $response) {
Expand All @@ -46,7 +46,7 @@ use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;

require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
require_once dirname(__DIR__) . '/vendor/autoload_runtime.php';

class App implements RequestHandlerInterface {
public function handle(ServerRequestInterface $request): ResponseInterface {
Expand All @@ -62,14 +62,14 @@ return function(): RequestHandlerInterface {

## Using Options

You can define some configurations using Symfony's Runtime `APP_RUNTIME_OPTIONS` API.
You can define some configurations using Symfony's Runtime [`APP_RUNTIME_OPTIONS` API](https://symfony.com/doc/current/components/runtime.html#using-options).

| Option | Description | Default |
| --- | --- | --- |
| `host` | The host where the server should binds to (precedes `SWOOLE_HOST` environment variable) | `127.0.0.1` |
| `port` | The port where the server should be listing (precedes `SWOOLE_PORT` environment variable) | `8000` |
| `mode` | Swoole's server mode (precedes `SWOOLE_MODE` environment variable) | `SWOOLE_PROCESS` |
| `settings` | All Swoole's server settings ([swoole.co.uk/docs/modules/swoole-server/configuration](https://www.swoole.co.uk/docs/modules/swoole-server/configuration)) | `[]` |
| `settings` | All Swoole's server settings ([wiki.swoole.com/en/#/server/setting](https://wiki.swoole.com/en/#/server/setting) and [wiki.swoole.com/en/#/http_server?id=configuration-options](https://wiki.swoole.com/en/#/http_server?id=configuration-options)) | `[]` |

```php
// public/index.php
Expand All @@ -81,13 +81,13 @@ $_SERVER['APP_RUNTIME_OPTIONS'] = [
'port' => 9501,
'mode' => SWOOLE_BASE,
'settings' => [
\Swoole\Constant::OPTION_WORKER_NUM => swoole_cpu_num() * 2,
\Swoole\Constant::OPTION_ENABLE_STATIC_HANDLER => true,
\Swoole\Constant::OPTION_DOCUMENT_ROOT => dirname(__DIR__).'/public'
'worker_num' => swoole_cpu_num() * 2,
'enable_static_handler' => true,
'document_root' => dirname(__DIR__) . '/public'
],
];

require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
require_once dirname(__DIR__) . '/vendor/autoload_runtime.php';

return function (array $context) {
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
Expand Down
18 changes: 9 additions & 9 deletions src/swoole/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Swoole Runtime

A runtime for [Swoole](https://www.swoole.co.uk/).
A runtime for [Swoole](https://www.swoole.com/).

If you are new to the Symfony Runtime component, read more in the [main readme](https://github.com/php-runtime/runtime).

Expand All @@ -26,7 +26,7 @@ APP_RUNTIME=Runtime\Swoole\Runtime
use Swoole\Http\Request;
use Swoole\Http\Response;

require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
require_once dirname(__DIR__) . '/vendor/autoload_runtime.php';

return function () {
return function (Request $request, Response $response) {
Expand All @@ -43,7 +43,7 @@ return function () {

use App\Kernel;

require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
require_once dirname(__DIR__) . '/vendor/autoload_runtime.php';

return function (array $context) {
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
Expand All @@ -52,14 +52,14 @@ return function (array $context) {

## Using Options

You can define some configurations using Symfony's Runtime `APP_RUNTIME_OPTIONS` API.
You can define some configurations using Symfony's Runtime [`APP_RUNTIME_OPTIONS` API](https://symfony.com/doc/current/components/runtime.html#using-options).

| Option | Description | Default |
| --- | --- | --- |
| `host` | The host where the server should binds to (precedes `SWOOLE_HOST` environment variable) | `127.0.0.1` |
| `port` | The port where the server should be listing (precedes `SWOOLE_PORT` environment variable) | `8000` |
| `mode` | Swoole's server mode (precedes `SWOOLE_MODE` environment variable) | `SWOOLE_PROCESS` |
| `settings` | All Swoole's server settings ([swoole.co.uk/docs/modules/swoole-server/configuration](https://www.swoole.co.uk/docs/modules/swoole-server/configuration)) | `[]` |
| `settings` | All Swoole's server settings ([wiki.swoole.com/en/#/server/setting](https://wiki.swoole.com/en/#/server/setting) and [wiki.swoole.com/en/#/http_server?id=configuration-options](https://wiki.swoole.com/en/#/http_server?id=configuration-options)) | `[]` |

```php
// public/index.php
Expand All @@ -71,13 +71,13 @@ $_SERVER['APP_RUNTIME_OPTIONS'] = [
'port' => 9501,
'mode' => SWOOLE_BASE,
'settings' => [
\Swoole\Constant::OPTION_WORKER_NUM => swoole_cpu_num() * 2,
\Swoole\Constant::OPTION_ENABLE_STATIC_HANDLER => true,
\Swoole\Constant::OPTION_DOCUMENT_ROOT => dirname(__DIR__).'/public'
'worker_num' => swoole_cpu_num() * 2,
'enable_static_handler' => true,
'document_root' => dirname(__DIR__) . '/public'
],
];

require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
require_once dirname(__DIR__) . '/vendor/autoload_runtime.php';

return function (array $context) {
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
Expand Down