function tep_delete_dir( $dir , $DeleteMe = false) { |
02 | if (! $dh = @opendir( $dir )) return ; |
03 | while (false !== ( $obj = readdir( $dh ))) { |
04 | if ( $obj == '.' || $obj == '..' ) continue ; |
05 | if (!@unlink( $dir . '/' . $obj )) tep_delete_dir( $dir . '/' . $obj , true); |
06 | } |
07 |
08 | closedir ( $dh ); |
09 | if ( $DeleteMe ){ |
10 | @ rmdir ( $dir ); |
11 | } |
12 | } |