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
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
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
Expand Up @@ -67,7 +67,10 @@
"autoload": {
"psr-4": {
"Mezzio\\Swoole\\": "src/"
}
},
"files": [
"compat/openswoole.php"
]
},
"autoload-dev": {
"psr-4": {
Expand Down
7 changes: 7 additions & 0 deletions docs/book/v4/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Loading