Skip to content

Commit

Permalink
Prepare for working with newer versions of OpenSwoole.
Browse files Browse the repository at this point in the history
Signed-off-by: Slavey Karadzhov <skaradzhov@perforce.com>
  • Loading branch information
slav-at-attachix authored and slaff-at-zend committed Feb 5, 2024
1 parent 3ab78a3 commit c5ec024
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
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(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

0 comments on commit c5ec024

Please sign in to comment.