From: Sebastien D. <sde...@us...> - 2005-04-22 08:34:41
|
Update of /cvsroot/tslogparser/web/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3651 Modified Files: purge.php Log Message: purge.php fix Index: purge.php =================================================================== RCS file: /cvsroot/tslogparser/web/admin/purge.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- purge.php 22 Apr 2005 08:30:33 -0000 1.2 +++ purge.php 22 Apr 2005 08:34:32 -0000 1.3 @@ -30,8 +30,8 @@ /* We'll need functions defined in other files */ require($root."functions.inc.php"); -function rmdirRecursive($path,$followLinks=false) { - +function rmdirRecursive($path,$racine=false) { + $dir = opendir($path) ; while ( $entry = readdir($dir) ) { @@ -39,14 +39,16 @@ unlink( "$path/$entry" ); } elseif ( is_dir( "$path/$entry" ) && $entry!='.' && $entry!='..' ) { rmdirRecursive( "$path/$entry" ) ; + if ($racine) + echo "Removed ".$path/$entry."<br>\n"; } } closedir($dir) ; - if ($path != $root."ts/") + if (!$racine) return rmdir($path); } -rmdirRecursive($root."ts/"); +rmdirRecursive($root."ts/", true); require($root."footer.inc.php"); |