public static function getTempDir()
{
global $conf;
/* If one has been specifically set, then use that */
if (!empty($conf['tmpdir'])) {
$tmp = $conf['tmpdir'];
}
/* Next, try sys_get_temp_dir(). */
if (empty($tmp)) {
$tmp = sys_get_temp_dir();
}
/* If it is still empty, we have failed, so return false;
* otherwise return the directory determined. */
return empty($tmp) ? false : $tmp;
}