mirror of
https://github.com/silverstripe/silverstripe-installer
synced 2024-10-22 17:05:33 +02:00
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:
parent
270ca68f41
commit
3702a09af1
29
install.php
29
install.php
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user