Merge pull request #427 from fritzmg/patch-1
Use fallback for posix_getpwuid on Windows
This commit is contained in:
commit
fc8da5b229
|
@ -471,6 +471,11 @@ class Runtime
|
|||
*/
|
||||
public function getCurrentUser(): string
|
||||
{
|
||||
// Windows fallback
|
||||
if (!function_exists('posix_getpwuid')) {
|
||||
return getenv('USERNAME') ?: '';
|
||||
}
|
||||
|
||||
$userData = posix_getpwuid(posix_geteuid());
|
||||
return $userData['name'];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue