diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index e60070f1179..eea895ada40 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -47,7 +47,7 @@ class Utils * Purge files into directory of data files. * CAN BE A CRON TASK * - * @param string $choice Choice of purge mode ('tempfiles', 'tempfilesold' to purge temp older than 24h, 'allfiles', 'logfile') + * @param string $choice Choice of purge mode ('tempfiles', '' or 'tempfilesold' to purge temp older than 24h, 'allfiles', 'logfile') * @return int 0 if OK, < 0 if KO (this function is used also by cron so only 0 is OK) */ function purgeFiles($choice='tempfilesold') @@ -129,7 +129,7 @@ class Utils } elseif ($filesarray[$key]['type'] == 'file') { - // If (file that is not logfile) or (if logfile with option logfile) + // If (file that is not logfile) or (if mode is logfile) if ($filesarray[$key]['fullname'] != $filelog || $choice=='logfile') { $result=dol_delete_file($filesarray[$key]['fullname'], 1, 1); @@ -138,7 +138,10 @@ class Utils $count++; $countdeleted++; } - else $counterror++; + else + { + $counterror++; + } } } } @@ -672,8 +675,8 @@ class Utils /** * This saves syslog files and compresses older ones * Used from cronjob - * - * @return int 0 if OK, < 0 if KO + * + * @return int 0 if OK, < 0 if KO */ function compressSyslogs() { global $conf; diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index ea5a7bd9b85..6ea633f1f1d 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1278,6 +1278,7 @@ function dol_delete_dir_recursive($dir, $count=0, $nophperrors=0, $onlysub=0, &$ $result=dol_delete_file("$dir/$item", 1, $nophperrors); $count++; if ($result) $countdeleted++; + //else print 'Error on '.$item."\n"; } } } @@ -1288,6 +1289,7 @@ function dol_delete_dir_recursive($dir, $count=0, $nophperrors=0, $onlysub=0, &$ $result=dol_delete_dir($dir, $nophperrors); $count++; if ($result) $countdeleted++; + //else print 'Error on '.$dir."\n"; } } }