Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare for working with newer versions of OpenSwoole. #128

Open
wants to merge 3 commits into
base: 4.10.x
Choose a base branch
from
Open
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
14 changes: 14 additions & 0 deletions compat/openswoole.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

declare(strict_types=1);

use OpenSwoole\Util;

// @see https://github.com/mezzio/mezzio-swoole/issues/110#issuecomment-1500174967
// Override the swoole_set_process_name function
if (version_compare((string)phpversion('openswoole'), '22.0.0', '>=')) {
function swoole_set_process_name(string $process_name): void
{
Util::setProcessName($process_name);
}
}
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -67,7 +67,10 @@
"autoload": {
"psr-4": {
"Mezzio\\Swoole\\": "src/"
}
},
"files": [
"compat/openswoole.php"
]
},
"autoload-dev": {
"psr-4": {
7 changes: 7 additions & 0 deletions docs/book/v4/migration.md
Original file line number Diff line number Diff line change
@@ -43,3 +43,10 @@ return [
```

If you are using Mezzio 3.11.0 or later, you can also use its `Mezzio\Container\FilterUsingXForwardedHeadersFactory` and related configuration to fine-tune which sources may be considered for usage of these headers.

## Support for OpenSwoole 22.0.x

INFO: Since 4.10.0 mezzio-swoole supports the use of openswoole PHP extension version 22.0 and later.

If your application has custom code that re-implements the function `swoole_set_process_name` then make sure to remove it.
This package will take care of the compatibility issues.

Unchanged files with check annotations Beta

- New routes
- New pipeline middleware
- The `Application` instance, _or any delegators used to modify it_.

Check failure on line 58 in docs/book/v2/hot-code-reload.md

GitHub Actions / ci / QA Checks (Documentation Linting [8.1, locked], ubuntu-latest, laminas/laminas-continuous-integra...

Emphasis style [Expected: asterisk; Actual: underscore]

Check failure on line 58 in docs/book/v2/hot-code-reload.md

GitHub Actions / ci / QA Checks (Documentation Linting [8.1, locked], ubuntu-latest, laminas/laminas-continuous-integra...

Emphasis style [Expected: asterisk; Actual: underscore]
- The Swoole HTTP server itself.
This limitation exists because the hot code reload features use the
serve it.
<!-- markdownlint-disable-next-line header-increment -->
> ### Disabling static resources

Check failure on line 26 in docs/book/v2/static-resources.md

GitHub Actions / ci / QA Checks (Documentation Linting [8.1, locked], ubuntu-latest, laminas/laminas-continuous-integra...

Heading levels should only increment by one level at a time [Expected: h2; Actual: h3]
>
> - Since 2.1.0
>
and table size inside of the constructor.
<!-- markdownlint-disable-next-line header-increment -->
> ### Initialize the Table Within the Constructor

Check failure on line 13 in docs/book/v2/table.md

GitHub Actions / ci / QA Checks (Documentation Linting [8.1, locked], ubuntu-latest, laminas/laminas-continuous-integra...

Heading levels should only increment by one level at a time [Expected: h2; Actual: h3]
>
> You **must** call your table's `create()` method, and this **must** be done
> prior to initializing any worker processes; if you fail to do so, your table
- New routes
- New pipeline middleware
- The `Application` instance, _or any delegators used to modify it_.

Check failure on line 65 in docs/book/v4/hot-code-reload.md

GitHub Actions / ci / QA Checks (Documentation Linting [8.1, locked], ubuntu-latest, laminas/laminas-continuous-integra...

Emphasis style [Expected: asterisk; Actual: underscore]

Check failure on line 65 in docs/book/v4/hot-code-reload.md

GitHub Actions / ci / QA Checks (Documentation Linting [8.1, locked], ubuntu-latest, laminas/laminas-continuous-integra...

Emphasis style [Expected: asterisk; Actual: underscore]
- The Swoole HTTP server itself.
This limitation exists because the hot code reload features use the
and table size inside of the constructor.
<!-- markdownlint-disable-next-line header-increment-->
> ### Initialize the Table Within the Constructor

Check failure on line 13 in docs/book/v4/table.md

GitHub Actions / ci / QA Checks (Documentation Linting [8.1, locked], ubuntu-latest, laminas/laminas-continuous-integra...

Heading levels should only increment by one level at a time [Expected: h2; Actual: h3]
>
> You **must** call your table's `create()` method, and this **must** be done
> prior to initializing any worker processes; if you fail to do so, your table
- New routes
- New pipeline middleware
- The `Application` instance, _or any delegators used to modify it_.

Check failure on line 65 in docs/book/v4/hot-code-reload.md

GitHub Actions / ci / QA Checks (Documentation Linting [8.1, locked], ubuntu-latest, laminas/laminas-continuous-integra...

Emphasis style [Expected: asterisk; Actual: underscore]

Check failure on line 65 in docs/book/v4/hot-code-reload.md

GitHub Actions / ci / QA Checks (Documentation Linting [8.1, locked], ubuntu-latest, laminas/laminas-continuous-integra...

Emphasis style [Expected: asterisk; Actual: underscore]
- The Swoole HTTP server itself.
This limitation exists because the hot code reload features use the
and table size inside of the constructor.
<!-- markdownlint-disable-next-line header-increment-->
> ### Initialize the Table Within the Constructor

Check failure on line 13 in docs/book/v4/table.md

GitHub Actions / ci / QA Checks (Documentation Linting [8.1, locked], ubuntu-latest, laminas/laminas-continuous-integra...

Heading levels should only increment by one level at a time [Expected: h2; Actual: h3]
>
> You **must** call your table's `create()` method, and this **must** be done
> prior to initializing any worker processes; if you fail to do so, your table