537819ba8a
darcs-hash:20080924150828-f6e2c-4c592c60b7ff6b0cae5a222a5d871fc875217e13.gz
15 lines
431 B
PHP
15 lines
431 B
PHP
<?php
|
|
if ( !function_exists('sys_get_temp_dir')) {
|
|
function sys_get_temp_dir() {
|
|
if (!empty($_ENV['TMP'])) { return realpath($_ENV['TMP']); }
|
|
if (!empty($_ENV['TMPDIR'])) { return realpath( $_ENV['TMPDIR']); }
|
|
if (!empty($_ENV['TEMP'])) { return realpath( $_ENV['TEMP']); }
|
|
$tempfile=tempnam(uniqid(rand(),TRUE),'');
|
|
if (file_exists($tempfile)) {
|
|
unlink($tempfile);
|
|
}
|
|
return realpath(dirname($tempfile));
|
|
}
|
|
}
|
|
?>
|