mirror of
https://github.com/silverstripe/silverstripe-installer
synced 2024-10-22 17:05:33 +02: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
40
install.php
40
install.php
@ -114,9 +114,7 @@ class InstallRequirements {
|
||||
$this->requireWriteable('tutorial', array("File permissions", "Is the tutorial/ folder writeable?", null));
|
||||
$this->requireWriteable('assets', array("File permissions", "Is the assets/ folder writeable?", null));
|
||||
|
||||
if(!is_writeable(dirname(tempnam('adfadsfdas','')))) {
|
||||
$this->error(array("File permissions", "Is the temporary folder writeable?", "The temporary folder isn't writeable!"));
|
||||
}
|
||||
$this->requireTempFolder(array('File permissions', 'Is the temporary folder writeable?', null));
|
||||
|
||||
// Check for rewriting
|
||||
|
||||
@ -316,6 +314,42 @@ class InstallRequirements {
|
||||
$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) {
|
||||
$this->testing($testDetails);
|
||||
if(!in_array($moduleName, apache_get_modules())) $this->error($testDetails);
|
||||
|
Loading…
Reference in New Issue
Block a user