Skip to content

Commit 16f59a1

Browse files
Prepare for working with newer versions of OpenSwoole.
1 parent 3ab78a3 commit 16f59a1

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

compat/openswoole.php

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use OpenSwoole\Util;
6+
7+
// @see https://github.com/mezzio/mezzio-swoole/issues/110#issuecomment-1500174967
8+
// Override the swoole_set_process_name function
9+
if (version_compare(phpversion('openswoole'), '22.0.0', '>=')) {
10+
function swoole_set_process_name(string $process_name): void
11+
{
12+
Util::setProcessName($process_name);
13+
}
14+
}

composer.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,10 @@
6767
"autoload": {
6868
"psr-4": {
6969
"Mezzio\\Swoole\\": "src/"
70-
}
70+
},
71+
"files": [
72+
"compat/openswoole.php"
73+
],
7174
},
7275
"autoload-dev": {
7376
"psr-4": {

0 commit comments

Comments
 (0)