use fallback for posix_getpwuid on Windows

This commit is contained in:
Fritz Michael Gschwantner 2018-09-10 18:27:56 +02:00 committed by fritzmg
parent e30de6b719
commit df248dd1b0

View file

@ -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'];
}