From b7d7a86b51bafef55fc7651fecbfdb7a3c2fc7e6 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Thu, 18 Nov 2010 21:35:11 +0000 Subject: [PATCH] MINOR Fixed spaces with tabs for Core::getTempFolder() git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@113923 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/Core.php | 56 ++++++++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/core/Core.php b/core/Core.php index a212c6b9c..9b87517bd 100755 --- a/core/Core.php +++ b/core/Core.php @@ -288,39 +288,41 @@ function getSysTempDir() { */ function getTempFolder($base = null) { if(!$base) $base = BASE_PATH; - + if($base) { $cachefolder = "silverstripe-cache" . str_replace(array(' ', "/", ":", "\\"), "-", $base); } else { $cachefolder = "silverstripe-cache"; } - - $ssTmp = BASE_PATH . "/silverstripe-cache"; - if(@file_exists($ssTmp)) { - return $ssTmp; - } - - $sysTmp = getSysTempDir(); - $worked = true; - $ssTmp = "$sysTmp/$cachefolder"; - if(!@file_exists($ssTmp)) { - @$worked = mkdir($ssTmp); - } - if(!$worked) { - $ssTmp = BASE_PATH . "/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; + $ssTmp = BASE_PATH . "/silverstripe-cache"; + if(@file_exists($ssTmp)) { + return $ssTmp; + } + + $sysTmp = getSysTempDir(); + $worked = true; + $ssTmp = "$sysTmp/$cachefolder"; + + if(!@file_exists($ssTmp)) { + @$worked = mkdir($ssTmp); + } + + if(!$worked) { + $ssTmp = BASE_PATH . "/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; } /**