Skip to content

Commit 3ba23e6

Browse files
authored
Merge pull request swooletw#407 from wenstionly/master
fix 'swoole_set_process_name' not found error on cygwin platform
2 parents 61aa077 + 7db04ae commit 3ba23e6

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/Helpers/OS.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ final class OS
3030
*/
3131
public const WIN = 'win';
3232

33+
/**
34+
* Cygwin
35+
*
36+
* @const string
37+
*/
38+
public const CYGWIN = 'cyg';
39+
3340
/**
3441
* Returns true if current OS in types
3542
*
@@ -51,4 +58,4 @@ public static function current(): string
5158
{
5259
return Str::substr(Str::lower(PHP_OS), 0, 3);
5360
}
54-
}
61+
}

src/Server/Manager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ protected function clearCache()
353353
protected function setProcessName($process)
354354
{
355355
// MacOS doesn't support modifying process name.
356-
if (OS::is(OS::MAC_OS) || $this->isInTesting()) {
356+
if (OS::is(OS::MAC_OS, OS::CYGWIN) || $this->isInTesting()) {
357357
return;
358358
}
359359
$serverName = 'swoole_http_server';

0 commit comments

Comments
 (0)