diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 5eba356..d0e2de1 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -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(); + } } diff --git a/index.php b/index.php index 60755cf..1a595ec 100644 --- a/index.php +++ b/index.php @@ -65,7 +65,9 @@ if (isset($_GET['login'])) { } elseif (isset($_GET['import'])) { $import = $poche->import($_GET['from']); } elseif (isset($_GET['download'])) { - Tools::download_db();; + Tools::download_db(); +} elseif (isset($_GET['empty-cache'])) { + $poche->emptyCache(); } elseif (isset($_GET['export'])) { $poche->export(); } elseif (isset($_GET['updatetheme'])) { diff --git a/themes/baggy/config.twig b/themes/baggy/config.twig index d0ec0ca..598409b 100644 --- a/themes/baggy/config.twig +++ b/themes/baggy/config.twig @@ -116,4 +116,8 @@ {% if constant('STORAGE') == 'sqlite' %}

{% trans "Click here" %} {% trans "to download your database." %}

{% endif %}

{% trans "Click here" %} {% trans "to export your wallabag data." %}

+ +

{% trans "Cache" %}

+

{% trans "Click here" %} {% trans "to delete cache." %}

+ {% endblock %}