mirror of
https://github.com/silverstripe/silverstripe-installer
synced 2024-10-22 15:05:33 +00:00
Added open_basedir workaround to installer
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/phpinstaller/trunk@40498 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
1e5fbb9247
commit
014bd34998
42
install.php
42
install.php
@ -114,9 +114,7 @@ class InstallRequirements {
|
|||||||
$this->requireWriteable('tutorial', array("File permissions", "Is the tutorial/ folder writeable?", null));
|
$this->requireWriteable('tutorial', array("File permissions", "Is the tutorial/ folder writeable?", null));
|
||||||
$this->requireWriteable('assets', array("File permissions", "Is the assets/ folder writeable?", null));
|
$this->requireWriteable('assets', array("File permissions", "Is the assets/ folder writeable?", null));
|
||||||
|
|
||||||
if(!is_writeable(dirname(tempnam('adfadsfdas','')))) {
|
$this->requireTempFolder(array('File permissions', 'Is the temporary folder writeable?', null));
|
||||||
$this->error(array("File permissions", "Is the temporary folder writeable?", "The temporary folder isn't writeable!"));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check for rewriting
|
// Check for rewriting
|
||||||
|
|
||||||
@ -315,7 +313,43 @@ class InstallRequirements {
|
|||||||
$testDetails[2] .= "User '$user[name]' needs to write be able to write to this file:\n$filename";
|
$testDetails[2] .= "User '$user[name]' needs to write be able to write to this file:\n$filename";
|
||||||
$this->error($testDetails);
|
$this->error($testDetails);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function requireTempFolder($testDetails) {
|
||||||
|
$this->testing($testDetails);
|
||||||
|
|
||||||
|
if(function_exists('sys_get_temp_dir')) {
|
||||||
|
$sysTmp = sys_get_temp_dir();
|
||||||
|
} elseif(isset($_ENV['TMP'])) {
|
||||||
|
$sysTmp = $_ENV['TMP'];
|
||||||
|
} else {
|
||||||
|
$tmpFile = tempnam('adfadsfdas','');
|
||||||
|
unlink($tmpFile);
|
||||||
|
$sysTmp = dirname($tmpFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
$worked = true;
|
||||||
|
$ssTmp = "$sysTmp/silverstripe-cache";
|
||||||
|
|
||||||
|
if(!@file_exists($ssTmp)) {
|
||||||
|
@$worked = mkdir($ssTmp);
|
||||||
|
|
||||||
|
if(!$worked) {
|
||||||
|
$ssTmp = dirname($_SERVER['SCRIPT_FILENAME']) . "/silverstripe-cache";
|
||||||
|
$worked = true;
|
||||||
|
if(!@file_exists($ssTmp)) {
|
||||||
|
@$worked = mkdir($ssTmp);
|
||||||
|
}
|
||||||
|
if(!$worked) {
|
||||||
|
$testDetails[2] = "Permission problem gaining access to a temp folder. " .
|
||||||
|
"Please create a folder named silverstripe-cache in the base folder " .
|
||||||
|
"of the installation and ensure it has the adequate permissions";
|
||||||
|
$this->error($testDetails);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function requireApacheModule($moduleName, $testDetails) {
|
function requireApacheModule($moduleName, $testDetails) {
|
||||||
$this->testing($testDetails);
|
$this->testing($testDetails);
|
||||||
if(!in_array($moduleName, apache_get_modules())) $this->error($testDetails);
|
if(!in_array($moduleName, apache_get_modules())) $this->error($testDetails);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user