Code comment

This commit is contained in:
Laurent Destailleur 2018-03-21 13:30:30 +01:00
parent 42b0a22df2
commit 7e5c3cc807
2 changed files with 10 additions and 5 deletions

View File

@ -47,7 +47,7 @@ class Utils
* Purge files into directory of data files. * Purge files into directory of data files.
* CAN BE A CRON TASK * 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) * @return int 0 if OK, < 0 if KO (this function is used also by cron so only 0 is OK)
*/ */
function purgeFiles($choice='tempfilesold') function purgeFiles($choice='tempfilesold')
@ -129,7 +129,7 @@ class Utils
} }
elseif ($filesarray[$key]['type'] == 'file') 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') if ($filesarray[$key]['fullname'] != $filelog || $choice=='logfile')
{ {
$result=dol_delete_file($filesarray[$key]['fullname'], 1, 1); $result=dol_delete_file($filesarray[$key]['fullname'], 1, 1);
@ -138,7 +138,10 @@ class Utils
$count++; $count++;
$countdeleted++; $countdeleted++;
} }
else $counterror++; else
{
$counterror++;
}
} }
} }
} }
@ -672,8 +675,8 @@ class Utils
/** /**
* This saves syslog files and compresses older ones * This saves syslog files and compresses older ones
* Used from cronjob * Used from cronjob
* *
* @return int 0 if OK, < 0 if KO * @return int 0 if OK, < 0 if KO
*/ */
function compressSyslogs() { function compressSyslogs() {
global $conf; global $conf;

View File

@ -1278,6 +1278,7 @@ function dol_delete_dir_recursive($dir, $count=0, $nophperrors=0, $onlysub=0, &$
$result=dol_delete_file("$dir/$item", 1, $nophperrors); $result=dol_delete_file("$dir/$item", 1, $nophperrors);
$count++; $count++;
if ($result) $countdeleted++; 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); $result=dol_delete_dir($dir, $nophperrors);
$count++; $count++;
if ($result) $countdeleted++; if ($result) $countdeleted++;
//else print 'Error on '.$dir."\n";
} }
} }
} }