recursive deletion is now in OC_HELPER
This commit is contained in:
parent
85cae2cc32
commit
f48344df30
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue