mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Create a temporary directory called silverstripe-cache in the project folder if access to the tmp folder is restricted
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@39797 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
b31d08041b
commit
eb700a58b7
@ -15,7 +15,22 @@ function getTempFolder() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$ssTmp = "$sysTmp/silverstripe-cache";
|
$ssTmp = "$sysTmp/silverstripe-cache";
|
||||||
if(!file_exists($ssTmp)) mkdir($ssTmp);
|
if(!file_exists($ssTmp)) {
|
||||||
|
@$worked = mkdir($ssTmp);
|
||||||
|
}
|
||||||
|
if(!$worked) {
|
||||||
|
$ssTmp = dirname(dirname($_SERVER['SCRIPT_FILENAME'])) . "/silverstripe-cache";
|
||||||
|
$worked = true;
|
||||||
|
if(!file_exists($ssTmp)) {
|
||||||
|
@$worked = mkdir($ssTmp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!$worked) {
|
||||||
|
user_error("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 correct permissions", E_USER_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
return $ssTmp;
|
return $ssTmp;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user