From df248dd1b00f759e017793c0b576e97f5e024afe Mon Sep 17 00:00:00 2001 From: Fritz Michael Gschwantner Date: Mon, 10 Sep 2018 18:27:56 +0200 Subject: [PATCH] use fallback for posix_getpwuid on Windows --- src/Runtime/Runtime.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Runtime/Runtime.php b/src/Runtime/Runtime.php index 5b7368d..006282e 100644 --- a/src/Runtime/Runtime.php +++ b/src/Runtime/Runtime.php @@ -517,6 +517,11 @@ class Runtime */ public function getCurrentUser() { + // Windows fallback + if (!function_exists('posix_getpwuid')) { + return getenv('USERNAME') ?: ''; + } + $userData = posix_getpwuid(posix_geteuid()); return $userData['name']; }