recursive deletion is now in OC_HELPER

This commit is contained in:
Robin Appelman 2011-05-29 17:01:34 +02:00
parent 85cae2cc32
commit f48344df30
1 changed files with 0 additions and 18 deletions

View File

@ -311,24 +311,6 @@ function zipAddDir($dir,$zip,$internalDir=''){
}
}
//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;