mirror of
https://github.com/amphp/parallel.git
synced 2025-01-17 20:58:36 +01:00
Simplify Windows checking (#141)
See https://www.php.net/manual/en/reserved.constants.php#constant.php-os-family
This commit is contained in:
parent
8b048caa71
commit
7fde6f1308
@ -33,7 +33,7 @@ class ProcessHub
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$isWindows = \strncasecmp(\PHP_OS, "WIN", 3) === 0;
|
||||
$isWindows = \PHP_OS_FAMILY === 'Windows';
|
||||
|
||||
if ($isWindows) {
|
||||
$this->uri = "tcp://127.0.0.1:0";
|
||||
|
@ -143,7 +143,7 @@ final class Process implements Context
|
||||
|
||||
private static function locateBinary(): string
|
||||
{
|
||||
$executable = \strncasecmp(\PHP_OS, "WIN", 3) === 0 ? "php.exe" : "php";
|
||||
$executable = \PHP_OS_FAMILY === 'Windows' ? "php.exe" : "php";
|
||||
|
||||
$paths = \array_filter(\explode(\PATH_SEPARATOR, \getenv("PATH")));
|
||||
$paths[] = \PHP_BINDIR;
|
||||
|
Loading…
x
Reference in New Issue
Block a user