MINOR Removed redundant system temp path discovery in tiny_mce_gzip,

juse use sys_get_temp_dir() instead which is always available.
This commit is contained in:
Sean Harvey 2012-04-16 12:19:08 +12:00
parent 4a3070757b
commit e6007c2637

View File

@ -9,29 +9,12 @@
* Contributing: http://tinymce.moxiecode.com/contributing
*/
// CUSTOM SilverStripe: Copied from Core.php
if(!function_exists('getSysTempDir')) {
function getSysTempDir() {
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);
}
return $sysTmp;
}
}
// CUSTOM END
// Handle incoming request if it's a script call
if (TinyMCE_Compressor::getParam("js")) {
// Default settings
$tinyMCECompressor = new TinyMCE_Compressor(array(
// CUSTOM SilverStripe
'cache_dir' => getSysTempDir()
'cache_dir' => sys_get_temp_dir()
// CUSTOM END
));