feat(Logator): add delete and reset

This commit is contained in:
Matthieu Bessat 2021-08-17 15:08:06 +02:00
parent b0185a9ac0
commit df5630a701
2 changed files with 32 additions and 2 deletions

View file

@ -54,3 +54,12 @@ function getDirsAsArray($path) {
}, $dirs);
return array_values($dirs);
}
function deleteAllFiles($path) {
$count = 0;
foreach (getFilesAsArray($path) as $file) {
unlink($path . '/' . $file);
$count++;
}
return $count;
}