fix: Errors with missing posix extension (#7666)

* fix: errors with missing posix extension
It should be an optional dependency

* add php71w-process to the CentOS 7 install docs
This commit is contained in:
Tony Murray
2017-11-10 09:20:47 -06:00
committed by Neil Lathwood
parent 301af24ace
commit b79d106c56
6 changed files with 21 additions and 9 deletions

View File

@@ -65,6 +65,13 @@ class Php implements ValidationGroup
$validator->fail("Missing CLI PHP extension: $extension", "Please install $extension");
}
}
$suggested_extensions = array('posix' => 'php-process');
foreach ($suggested_extensions as $extension => $packages) {
if (!extension_loaded($extension)) {
$validator->warn("Missing optional PHP extension: $extension", "It is suggested you install $packages or the one that matches your php version");
}
}
}
private function checkFunctions(Validator $validator)

View File

@@ -49,7 +49,7 @@ class User implements ValidationGroup
if (isCli()) {
$validator->fail('You need to run this script as root' .
(Config::has('user') ? ' or ' . $lnms_username : ''));
} else {
} elseif (function_exists('posix_getgrnam')) {
$lnms_group = posix_getgrnam($lnms_groupname);
if (!in_array($username, $lnms_group['members'])) {
$validator->fail(