Skip to content

Commit b294015

Browse files
committed
Add extension_loaded() check for posix function
1 parent d1d30a8 commit b294015

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PhpBrew/Command/InstallCommand.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public function options($opts)
164164

165165
public function execute($version)
166166
{
167-
if (posix_getuid() == 0) {
167+
if (extension_loaded('posix') && posix_getuid() === 0) {
168168
$this->logger->warn(
169169
"*WARNING* You're runing phpbrew as root/sudo. Unless you're going to install
170170
system-wide phpbrew or this might cause problems.");

0 commit comments

Comments
 (0)