diff options
Diffstat (limited to 'inc/poche/Poche.class.php')
-rw-r--r-- | inc/poche/Poche.class.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 5eba3564..d0e2de1f 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php | |||
@@ -1057,4 +1057,20 @@ class Poche | |||
1057 | $feed->genarateFeed(); | 1057 | $feed->genarateFeed(); |
1058 | exit; | 1058 | exit; |
1059 | } | 1059 | } |
1060 | |||
1061 | public function emptyCache() { | ||
1062 | $files = new RecursiveIteratorIterator( | ||
1063 | new RecursiveDirectoryIterator(CACHE, RecursiveDirectoryIterator::SKIP_DOTS), | ||
1064 | RecursiveIteratorIterator::CHILD_FIRST | ||
1065 | ); | ||
1066 | |||
1067 | foreach ($files as $fileinfo) { | ||
1068 | $todo = ($fileinfo->isDir() ? 'rmdir' : 'unlink'); | ||
1069 | $todo($fileinfo->getRealPath()); | ||
1070 | } | ||
1071 | |||
1072 | Tools::logm('empty cache'); | ||
1073 | $this->messages->add('s', _('Cache deleted.')); | ||
1074 | Tools::redirect(); | ||
1075 | } | ||
1060 | } | 1076 | } |