mirror of
https://github.com/andres-montanez/Magallanes
synced 2024-05-03 06:23:15 +02:00
use fallback for posix_getpwuid on Windows
This commit is contained in:
parent
e30de6b719
commit
df248dd1b0
|
@ -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'];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue