Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

fix 'swoole_set_process_name' not found error on cygwin platform #407

Merged
merged 1 commit into from
Sep 21, 2020
Merged
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
9 changes: 8 additions & 1 deletion src/Helpers/OS.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ final class OS
*/
public const WIN = 'win';

/**
* Cygwin
*
* @const string
*/
public const CYGWIN = 'cyg';

/**
* Returns true if current OS in types
*
Expand All @@ -51,4 +58,4 @@ public static function current(): string
{
return Str::substr(Str::lower(PHP_OS), 0, 3);
}
}
}
2 changes: 1 addition & 1 deletion src/Server/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ protected function clearCache()
protected function setProcessName($process)
{
// MacOS doesn't support modifying process name.
if (OS::is(OS::MAC_OS) || $this->isInTesting()) {
if (OS::is(OS::MAC_OS, OS::CYGWIN) || $this->isInTesting()) {
return;
}
$serverName = 'swoole_http_server';
Expand Down