changeset 183:74889db8e6a2

Cleanup.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 14 Mar 2018 13:52:49 +0200
parents c0439644da6a
children 087df916b6b4
files mgtool.php
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mgtool.php	Wed Mar 14 13:51:18 2018 +0200
+++ b/mgtool.php	Wed Mar 14 13:52:49 2018 +0200
@@ -317,7 +317,7 @@
 //
 // Delete given directory OR file, recursively
 //
-function mgDelete($path, $recurse)
+function mgDelete($path, $showFiles)
 {
   global $flagDoDelete, $countDoDelete;
   if (is_dir($path))
@@ -328,8 +328,9 @@
     while (($dirFile = @readdir($dirHandle)) !== FALSE)
     {
       if ($dirFile != "." && $dirFile != "..")
-        mgDelete($path."/".$dirFile, $recurse);
+        mgDelete($path."/".$dirFile, $showFiles);
     }
+
     closedir($dirHandle);
 
     echo " - ".$path." [DIR]\n";
@@ -340,7 +341,7 @@
   else
   if (file_exists($path))
   {
-    if (!$recurse)
+    if ($showFiles)
       echo " - ".$path."\n";
 
     $countDoDelete++;
@@ -496,10 +497,10 @@
     if ($writeMode)
     {
       if ($galCleanFlags & GCLEAN_CACHES)
-        mgDelete($cacheFilename, FALSE);
+        mgDelete($cacheFilename, TRUE);
 
       if ($galCleanFlags & GCLEAN_THUMBNAILS)
-        mgDelete($path."/".$galTNPath, TRUE);
+        mgDelete($path."/".$galTNPath, FALSE);
     }
   }
   else