Optimizer semi-gardening

This commit is contained in:
2021-01-06 19:57:40 +01:00
parent 2eddcd905d
commit 397c7d3436
2 changed files with 44 additions and 36 deletions
+16
View File
@@ -64,4 +64,20 @@ class utils
{
return self::remove_trailing_slashes(self::to_unix_slashes($path));
}
public static function delete_if_exists(string $file) : void
{
if (file_exists($file))
{
unlink($file);
}
}
public static function array_delete_if_exists(array $files_list) : void
{
foreach ($files_list as $file)
{
self::delete_if_exists($file);
}
}
}