If there's a silverstripe-cache directory in the silverstripe folder, always use that instead of /tmp

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.1.0@41576 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Andrew O'Neil 2007-09-11 23:47:50 +00:00 committed by Sam Minnee
parent 557296b52a
commit 2ff0a30980

View File

@ -4,6 +4,11 @@
* This is loaded into the TEMP_FOLDER define on start up
*/
function getTempFolder() {
$ssTmp = dirname(dirname($_SERVER['SCRIPT_FILENAME'])) . "/silverstripe-cache";
if(@file_exists($ssTmp)) {
return $ssTmp;
}
if(function_exists('sys_get_temp_dir')) {
$sysTmp = sys_get_temp_dir();
} elseif(isset($_ENV['TMP'])) {