Update config.php to delete all, including dirs
This commit is contained in:
parent
4386451516
commit
cdee7c8a04
1 changed files with 5 additions and 6 deletions
11
src/cron.php
11
src/cron.php
|
@ -1,8 +1,7 @@
|
|||
<?php
|
||||
$cacheFiles = glob(__DIR__ . DIRECTORY_SEPARATOR . 'Cache' . DIRECTORY_SEPARATOR . '*.*');
|
||||
foreach($cacheFiles as $cacheFile){
|
||||
if(is_file($cacheFile)) {
|
||||
unlink($cacheFile);
|
||||
}
|
||||
$cacheDir = __DIR__ . DIRECTORY_SEPARATOR . 'Cache' . DIRECTORY_SEPARATOR;
|
||||
$di = new RecursiveDirectoryIterator($cacheDir, FilesystemIterator::SKIP_DOTS);
|
||||
$ri = new RecursiveIteratorIterator($di, RecursiveIteratorIterator::CHILD_FIRST);
|
||||
foreach ($ri as $file) {
|
||||
$file->isDir() ? rmdir($file->getRealPath()) : unlink($file->getRealPath());
|
||||
}
|
||||
?>
|
||||
|
|
Loading…
Add table
Reference in a new issue