mirror of
https://github.com/moparisthebest/wallabag
synced 2024-11-27 11:22:17 -05:00
[add] link to empty cache in config screen, #454
This commit is contained in:
parent
243e13ab59
commit
6285e57c49
@ -1057,4 +1057,20 @@ class Poche
|
|||||||
$feed->genarateFeed();
|
$feed->genarateFeed();
|
||||||
exit;
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,9 @@ if (isset($_GET['login'])) {
|
|||||||
} elseif (isset($_GET['import'])) {
|
} elseif (isset($_GET['import'])) {
|
||||||
$import = $poche->import($_GET['from']);
|
$import = $poche->import($_GET['from']);
|
||||||
} elseif (isset($_GET['download'])) {
|
} elseif (isset($_GET['download'])) {
|
||||||
Tools::download_db();;
|
Tools::download_db();
|
||||||
|
} elseif (isset($_GET['empty-cache'])) {
|
||||||
|
$poche->emptyCache();
|
||||||
} elseif (isset($_GET['export'])) {
|
} elseif (isset($_GET['export'])) {
|
||||||
$poche->export();
|
$poche->export();
|
||||||
} elseif (isset($_GET['updatetheme'])) {
|
} elseif (isset($_GET['updatetheme'])) {
|
||||||
|
@ -116,4 +116,8 @@
|
|||||||
{% if constant('STORAGE') == 'sqlite' %}
|
{% if constant('STORAGE') == 'sqlite' %}
|
||||||
<p><a href="?download" target="_blank">{% trans "Click here" %}</a> {% trans "to download your database." %}</p>{% endif %}
|
<p><a href="?download" target="_blank">{% trans "Click here" %}</a> {% trans "to download your database." %}</p>{% endif %}
|
||||||
<p><a href="?export" target="_blank">{% trans "Click here" %}</a> {% trans "to export your wallabag data." %}</p>
|
<p><a href="?export" target="_blank">{% trans "Click here" %}</a> {% trans "to export your wallabag data." %}</p>
|
||||||
|
|
||||||
|
<h2>{% trans "Cache" %}</h2>
|
||||||
|
<p><a href="?empty-cache">{% trans "Click here" %}</a> {% trans "to delete cache." %}</p>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Loading…
Reference in New Issue
Block a user