the silverstripe-cache folder is now named according to the location of the silverstripe install, meaning that there are no clashes of permissions on shared servers (merged from branches/2.2.0, r44847)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@44902 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Andrew O'Neil 2007-11-15 22:33:35 +00:00
parent f58a5c7992
commit 7acd5738be

View File

@ -4,7 +4,8 @@
* This is loaded into the TEMP_FOLDER define on start up
*/
function getTempFolder() {
$ssTmp = dirname(dirname($_SERVER['SCRIPT_FILENAME'])) . "/silverstripe-cache";
$cachefolder = "silverstripe-cache" . str_replace(array("/",":", "\\"),"-", substr($_SERVER['SCRIPT_FILENAME'], 0, strlen($_SERVER['SCRIPT_FILENAME']) - strlen('/sapphire/main.php')));
$ssTmp = dirname(dirname($_SERVER['SCRIPT_FILENAME'])) . "/" . $cachefolder;
if(@file_exists($ssTmp)) {
return $ssTmp;
}
@ -20,7 +21,7 @@ function getTempFolder() {
}
$worked = true;
$ssTmp = "$sysTmp/silverstripe-cache";
$ssTmp = "$sysTmp/$cachefolder";
if(!@file_exists($ssTmp)) {
@$worked = mkdir($ssTmp);
}
@ -127,4 +128,4 @@ function _t($entity, $string = "", $priority = 40, $context = "") {
}
?>
?>