Code comment
This commit is contained in:
parent
42b0a22df2
commit
7e5c3cc807
@ -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++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user