Return a dummy PHP username in case the POSIX module is not available

This commit is contained in:
Johannes Meyer 2014-10-29 16:22:41 +01:00
parent 81e06fe570
commit 4d8842db09
1 changed files with 6 additions and 2 deletions

View File

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