1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-07-22 17:18:37 +00:00

[add] link to empty cache in config screen, #454

This commit is contained in:
Nicolas Lœuillet 2014-02-14 15:11:57 +01:00
parent 243e13ab59
commit 6285e57c49
3 changed files with 23 additions and 1 deletions

View file

@ -1057,4 +1057,20 @@ class Poche
$feed->genarateFeed();
exit;
}
public function emptyCache() {
$files = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator(CACHE, RecursiveDirectoryIterator::SKIP_DOTS),
RecursiveIteratorIterator::CHILD_FIRST
);
foreach ($files as $fileinfo) {
$todo = ($fileinfo->isDir() ? 'rmdir' : 'unlink');
$todo($fileinfo->getRealPath());
}
Tools::logm('empty cache');
$this->messages->add('s', _('Cache deleted.'));
Tools::redirect();
}
}