Refine cache purgring
This commit is contained in:
28
action.php
28
action.php
@@ -657,12 +657,30 @@ class action_plugin_luxtools extends ActionPlugin
|
||||
return;
|
||||
}
|
||||
|
||||
$removed = CacheInvalidation::purgeAll();
|
||||
$message = (string)$this->getLang('cache_invalidate_success');
|
||||
if ($message === '') {
|
||||
$message = 'DokuWiki cache invalidated.';
|
||||
$result = CacheInvalidation::purgeSelected(
|
||||
$INPUT->bool('luxtools_purge_pagelinks'),
|
||||
$INPUT->bool('luxtools_purge_thumbs')
|
||||
);
|
||||
|
||||
$parts = [];
|
||||
|
||||
$dokuwikiMsg = (string)$this->getLang('cache_invalidate_success');
|
||||
if ($dokuwikiMsg === '') $dokuwikiMsg = 'DokuWiki cache invalidated.';
|
||||
$parts[] = $dokuwikiMsg . ' (' . $result['dokuwiki'] . ')';
|
||||
|
||||
if ($result['pagelinks'] !== null) {
|
||||
$msg = (string)$this->getLang('cache_purge_pagelinks_success');
|
||||
if ($msg === '') $msg = 'Pagelinks cache purged.';
|
||||
$parts[] = $msg . ' (' . $result['pagelinks'] . ')';
|
||||
}
|
||||
msg($message . ' (' . $removed . ')', 1);
|
||||
|
||||
if ($result['thumbs'] !== null) {
|
||||
$msg = (string)$this->getLang('cache_purge_thumbs_success');
|
||||
if ($msg === '') $msg = 'Thumbnail cache purged.';
|
||||
$parts[] = $msg . ' (' . $result['thumbs'] . ')';
|
||||
}
|
||||
|
||||
msg(implode(' ', $parts), 1);
|
||||
|
||||
$this->redirectToShow($id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user