If posix module is not enabled, just show a warning

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/phpinstaller/trunk@41577 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
aoneil 2007-09-12 00:02:14 +00:00
parent 270ca68f41
commit 3702a09af1

View File

@ -300,18 +300,23 @@ class InstallRequirements {
function requireWriteable($filename, $testDetails) {
$this->testing($testDetails);
$filename = $this->getBaseDir() . $filename;
if(!is_writeable($filename)) {
$user = posix_getpwuid(posix_geteuid());
$groups = posix_getgroups();
foreach($groups as $group) {
$groupInfo = posix_getgrgid($group);
$groupList[] = $groupInfo['name'];
}
$groupList = "'" . implode("', '", $groupList) . "'";
$testDetails[2] .= "User '$user[name]' needs to write be able to write to this file:\n$filename";
$this->error($testDetails);
if(function_exists('posix_getgroups')) {
if(!is_writeable($filename)) {
$user = posix_getpwuid(posix_geteuid());
$groups = posix_getgroups();
foreach($groups as $group) {
$groupInfo = posix_getgrgid($group);
$groupList[] = $groupInfo['name'];
}
$groupList = "'" . implode("', '", $groupList) . "'";
$testDetails[2] .= "User '$user[name]' needs to write be able to write to this file:\n$filename";
$this->error($testDetails);
}
} else {
$testDetails[2] .= "Unable to detect whether I can write to files. Please ensure $filename is writable.";
$this->warning($testDetails);
}
}