Skip to content

Commit 522e812

Browse files
Updating links and examples to use Swoole instead of OpenSwoole (#170)
https://swoole.co.uk/ redirects to OpenSwoole, which is a different extension than Swoole. This updates the README.md file with the correct examples for Swoole.
1 parent 995f141 commit 522e812

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

src/swoole-nyholm/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Swoole Runtime with nyholm/psr7
22

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

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

@@ -26,7 +26,7 @@ APP_RUNTIME=Runtime\SwooleNyholm\Runtime
2626
use Swoole\Http\Request;
2727
use Swoole\Http\Response;
2828

29-
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
29+
require_once dirname(__DIR__) . '/vendor/autoload_runtime.php';
3030

3131
return function () {
3232
return function (Request $request, Response $response) {
@@ -46,7 +46,7 @@ use Psr\Http\Message\ResponseInterface;
4646
use Psr\Http\Message\ServerRequestInterface;
4747
use Psr\Http\Server\RequestHandlerInterface;
4848

49-
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
49+
require_once dirname(__DIR__) . '/vendor/autoload_runtime.php';
5050

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

6363
## Using Options
6464

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

6767
| Option | Description | Default |
6868
| --- | --- | --- |
6969
| `host` | The host where the server should binds to (precedes `SWOOLE_HOST` environment variable) | `127.0.0.1` |
7070
| `port` | The port where the server should be listing (precedes `SWOOLE_PORT` environment variable) | `8000` |
7171
| `mode` | Swoole's server mode (precedes `SWOOLE_MODE` environment variable) | `SWOOLE_PROCESS` |
72-
| `settings` | All Swoole's server settings ([swoole.co.uk/docs/modules/swoole-server/configuration](https://www.swoole.co.uk/docs/modules/swoole-server/configuration)) | `[]` |
72+
| `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)) | `[]` |
7373

7474
```php
7575
// public/index.php
@@ -81,13 +81,13 @@ $_SERVER['APP_RUNTIME_OPTIONS'] = [
8181
'port' => 9501,
8282
'mode' => SWOOLE_BASE,
8383
'settings' => [
84-
\Swoole\Constant::OPTION_WORKER_NUM => swoole_cpu_num() * 2,
85-
\Swoole\Constant::OPTION_ENABLE_STATIC_HANDLER => true,
86-
\Swoole\Constant::OPTION_DOCUMENT_ROOT => dirname(__DIR__).'/public'
84+
'worker_num' => swoole_cpu_num() * 2,
85+
'enable_static_handler' => true,
86+
'document_root' => dirname(__DIR__) . '/public'
8787
],
8888
];
8989

90-
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
90+
require_once dirname(__DIR__) . '/vendor/autoload_runtime.php';
9191

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

src/swoole/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Swoole Runtime
22

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

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

@@ -26,7 +26,7 @@ APP_RUNTIME=Runtime\Swoole\Runtime
2626
use Swoole\Http\Request;
2727
use Swoole\Http\Response;
2828

29-
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
29+
require_once dirname(__DIR__) . '/vendor/autoload_runtime.php';
3030

3131
return function () {
3232
return function (Request $request, Response $response) {
@@ -43,7 +43,7 @@ return function () {
4343

4444
use App\Kernel;
4545

46-
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
46+
require_once dirname(__DIR__) . '/vendor/autoload_runtime.php';
4747

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

5353
## Using Options
5454

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

5757
| Option | Description | Default |
5858
| --- | --- | --- |
5959
| `host` | The host where the server should binds to (precedes `SWOOLE_HOST` environment variable) | `127.0.0.1` |
6060
| `port` | The port where the server should be listing (precedes `SWOOLE_PORT` environment variable) | `8000` |
6161
| `mode` | Swoole's server mode (precedes `SWOOLE_MODE` environment variable) | `SWOOLE_PROCESS` |
62-
| `settings` | All Swoole's server settings ([swoole.co.uk/docs/modules/swoole-server/configuration](https://www.swoole.co.uk/docs/modules/swoole-server/configuration)) | `[]` |
62+
| `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)) | `[]` |
6363

6464
```php
6565
// public/index.php
@@ -71,13 +71,13 @@ $_SERVER['APP_RUNTIME_OPTIONS'] = [
7171
'port' => 9501,
7272
'mode' => SWOOLE_BASE,
7373
'settings' => [
74-
\Swoole\Constant::OPTION_WORKER_NUM => swoole_cpu_num() * 2,
75-
\Swoole\Constant::OPTION_ENABLE_STATIC_HANDLER => true,
76-
\Swoole\Constant::OPTION_DOCUMENT_ROOT => dirname(__DIR__).'/public'
74+
'worker_num' => swoole_cpu_num() * 2,
75+
'enable_static_handler' => true,
76+
'document_root' => dirname(__DIR__) . '/public'
7777
],
7878
];
7979

80-
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
80+
require_once dirname(__DIR__) . '/vendor/autoload_runtime.php';
8181

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

0 commit comments

Comments
 (0)