Browse Source

add image cache clean

master
filesite 2 months ago
parent
commit
5dfb96ebe1
  1. 13
      themes/beauty/controller/SiteController.php

13
themes/beauty/controller/SiteController.php

@ -283,6 +283,19 @@ Class SiteController extends Controller {
unlink("{$cacheDir}{$file}"); unlink("{$cacheDir}{$file}");
} }
//删除图片缓存: image/
$imgCacheDir = "{$cacheDir}image/";
if (is_dir($imgCacheDir)) {
$files = scandir($imgCacheDir);
foreach($files as $file) {
if (!preg_match('/\.json$/i', $file)) {continue;}
unlink("{$imgCacheDir}{$file}");
}
rmdir($imgCacheDir);
}
} }
}catch(Exception $e) { }catch(Exception $e) {
$code = 0; $code = 0;

Loading…
Cancel
Save