diff --git a/compat/openswoole.php b/compat/openswoole.php new file mode 100644 index 00000000..2e4760d6 --- /dev/null +++ b/compat/openswoole.php @@ -0,0 +1,14 @@ +=')) { + function swoole_set_process_name(string $process_name): void + { + Util::setProcessName($process_name); + } +} diff --git a/composer.json b/composer.json index d969ee42..e5d42772 100644 --- a/composer.json +++ b/composer.json @@ -67,7 +67,10 @@ "autoload": { "psr-4": { "Mezzio\\Swoole\\": "src/" - } + }, + "files": [ + "compat/openswoole.php" + ] }, "autoload-dev": { "psr-4": { diff --git a/docs/book/v4/migration.md b/docs/book/v4/migration.md index e25cebb1..6b83d547 100644 --- a/docs/book/v4/migration.md +++ b/docs/book/v4/migration.md @@ -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.