Return a dummy PHP username in case the POSIX module is not available
This commit is contained in:
parent
81e06fe570
commit
4d8842db09
|
@ -152,8 +152,12 @@ class Platform
|
|||
return get_current_user(); // http://php.net/manual/en/function.get-current-user.php#75059
|
||||
}
|
||||
|
||||
$userInfo = posix_getpwuid(posix_geteuid());
|
||||
return $userInfo['name'];
|
||||
if (function_exists('posix_geteuid')) {
|
||||
$userInfo = posix_getpwuid(posix_geteuid());
|
||||
return $userInfo['name'];
|
||||
}
|
||||
|
||||
return 'php_username';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue