aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas.loeuillet@gmail.com>2014-02-14 15:11:57 +0100
committerNicolas LÅ“uillet <nicolas.loeuillet@gmail.com>2014-02-14 15:11:57 +0100
commit6285e57c49bd06ed52ab997f0dc767576b7da126 (patch)
tree402ffd66fcd32d2847bd2cf476c71b49bf373e2b
parent243e13ab598bd3c4c711b8070cfaa048a3243fa3 (diff)
downloadwallabag-6285e57c49bd06ed52ab997f0dc767576b7da126.tar.gz
wallabag-6285e57c49bd06ed52ab997f0dc767576b7da126.tar.zst
wallabag-6285e57c49bd06ed52ab997f0dc767576b7da126.zip
[add] link to empty cache in config screen, #454
-rw-r--r--inc/poche/Poche.class.php16
-rw-r--r--index.php4
-rw-r--r--themes/baggy/config.twig4
3 files changed, 23 insertions, 1 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}
diff --git a/index.php b/index.php
index 60755cf7..1a595ece 100644
--- a/index.php
+++ b/index.php
@@ -65,7 +65,9 @@ if (isset($_GET['login'])) {
65} elseif (isset($_GET['import'])) { 65} elseif (isset($_GET['import'])) {
66 $import = $poche->import($_GET['from']); 66 $import = $poche->import($_GET['from']);
67} elseif (isset($_GET['download'])) { 67} elseif (isset($_GET['download'])) {
68 Tools::download_db();; 68 Tools::download_db();
69} elseif (isset($_GET['empty-cache'])) {
70 $poche->emptyCache();
69} elseif (isset($_GET['export'])) { 71} elseif (isset($_GET['export'])) {
70 $poche->export(); 72 $poche->export();
71} elseif (isset($_GET['updatetheme'])) { 73} elseif (isset($_GET['updatetheme'])) {
diff --git a/themes/baggy/config.twig b/themes/baggy/config.twig
index d0ec0ca7..598409b9 100644
--- a/themes/baggy/config.twig
+++ b/themes/baggy/config.twig
@@ -116,4 +116,8 @@
116 {% if constant('STORAGE') == 'sqlite' %} 116 {% if constant('STORAGE') == 'sqlite' %}
117 <p><a href="?download" target="_blank">{% trans "Click here" %}</a> {% trans "to download your database." %}</p>{% endif %} 117 <p><a href="?download" target="_blank">{% trans "Click here" %}</a> {% trans "to download your database." %}</p>{% endif %}
118 <p><a href="?export" target="_blank">{% trans "Click here" %}</a> {% trans "to export your wallabag data." %}</p> 118 <p><a href="?export" target="_blank">{% trans "Click here" %}</a> {% trans "to export your wallabag data." %}</p>
119
120 <h2>{% trans "Cache" %}</h2>
121 <p><a href="?empty-cache">{% trans "Click here" %}</a> {% trans "to delete cache." %}</p>
122
119{% endblock %} 123{% endblock %}