}
}
-//remove a dir and it's content
-function delTree($dir) {
- if (!file_exists($dir)) return true;
- if (!is_dir($dir) || is_link($dir)) return unlink($dir);
- foreach (scandir($dir) as $item) {
- if ($item == '.' || $item == '..') continue;
- if(is_file($dir.'/'.$item)){
- unlink($dir.'/'.$item);
- }elseif(is_dir($dir.'/'.$item)){
- if (!delTree($dir. "/" . $item)){
- return false;
- };
- }
- }
- $return=rmdir($dir);
- return $return;
-}
-
if(!function_exists('sys_get_temp_dir')) {
function sys_get_temp_dir() {
if( $temp=getenv('TMP') ) return $temp;