posix_getuid
Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Return the real user ID of the current process
posix_getuid
():
int
composer/composer
&& !
Platform
::
getEnv
(
'COMPOSER_ALLOW_SUPERUSER'
)
&& (
ini_get
(
'open_basedir'
) || !
file_exists
(
'/.dockerenv'
))
) {
if (
function_exists
(
'posix_getuid'
) &&
posix_getuid
() ===
0
) {
if (
$commandName
!==
'self-update'
&&
$commandName
!==
'selfupdate'
) {
$io
->
writeError
(
'<warning>Do not run Composer as root/super user! See https://getcomposer.org/root for details</warning>'
);
src/Composer/Console/Application.php
composer/composer
}
if (
\function_exists
(
'posix_getuid'
) &&
\function_exists
(
'posix_getpwuid'
)) {
$info
=
posix_getpwuid
(
posix_getuid
());
return
$info
[
'dir'
];
}
src/Composer/Util/Platform.php