Soshot/app/Utils/DeleteGen.php

19 lines
405 B
PHP

<?php
namespace App\Utils;
class DeleteGen {
function deleteGen(string $hashFile) {
$dir = __DIR__ . '/../../cache/img/' . substr($hashFile, 0, 4) . '/';
if (is_dir($dir)) {
$listFile = glob($dir . '*');
foreach ($listFile as $file) {
if (is_file($file)) {
unlink($file);
}
}
}
}
}