From: Sebastien D. <sde...@us...> - 2005-07-11 09:10:08
|
Update of /cvsroot/tslogparser/tslogparser/admin/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5890/admin/modules Modified Files: tahi.mod.php Log Message: Fix in tahi.mod.php Index: tahi.mod.php =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/admin/modules/tahi.mod.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- tahi.mod.php 6 Jul 2005 06:46:09 -0000 1.6 +++ tahi.mod.php 11 Jul 2005 09:09:59 -0000 1.7 @@ -217,6 +217,24 @@ return TRUE; } +/* Recursively delete a directory with all its content */ +function deldir($dir) { + $dh=opendir($dir); + while ($file=readdir($dh)) { + if($file!="." && $file!="..") { + $fullpath=$dir."/".$file; + if(!is_dir($fullpath)) { + unlink($fullpath); + } else { + deldir($fullpath); + } + } + } + closedir($dh); + rmdir($dir); +} + + class tahi { /* @@ -864,22 +882,6 @@ echo "$count results were inserted in the database.\n"; /* Delete the extracted tarball */ - function deldir($dir) { - $dh=opendir($dir); - while ($file=readdir($dh)) { - if($file!="." && $file!="..") { - $fullpath=$dir."/".$file; - if(!is_dir($fullpath)) { - unlink($fullpath); - } else { - deldir($fullpath); - } - } - } - closedir($dh); - rmdir($dir); - } - deldir($tmpdir); return true; |