Skip to content
Snippets Groups Projects
Commit 99bfac0b authored by Yassine Doghri's avatar Yassine Doghri
Browse files

feat(housekeeping): add clear_cache option to flush redis or files cache

parent 42d92d0c
No related branches found
No related tags found
No related merge requests found
......@@ -283,6 +283,10 @@ class SettingsController extends BaseController
}
}
if ($this->request->getPost('clear_cache') === 'yes') {
cache()->clean();
}
return redirect('settings-general')->with('message', lang('Settings.housekeeping.runSuccess'));
}
......
......@@ -35,6 +35,8 @@ return [
'reset_counts_helper' => 'This option will recalculate and reset all data counts (number of followers, posts, comments, …).',
'rewrite_media' => 'Rewrite media metadata',
'rewrite_media_helper' => 'This option will delete all superfluous media files and recreate them (images, audio files, transcripts, chapters, …)',
'clear_cache' => 'Clear all cache',
'clear_cache_helper' => 'This option will flush redis cache or writable/cache files.',
'run' => 'Run housekeeping',
'runSuccess' => 'Housekeeping has been run successfully!',
],
......
......@@ -35,6 +35,8 @@ return [
'reset_counts_helper' => 'Cette option recalcul et réinitialise les compteurs de données (nombre d’abonné·e·s, de publications, de commentaires, …).',
'rewrite_media' => 'Réécrire les métadonnées des fichiers média',
'rewrite_media_helper' => 'Cette option supprimera tous les fichiers média superflus et les recréera (images, fichiers audio, transcripts, chapitrages, …)',
'clear_cache' => 'Supprimer tout le cache',
'clear_cache_helper' => 'Cette option supprimera l’intégralité du cache redis ou des fichiers cache du dossier writable/cache.',
'run' => 'Faire le ménage',
'runSuccess' => 'Le ménage a été effectué avec succès !',
],
......
......@@ -79,6 +79,7 @@
<Forms.Toggler name="reset_counts" value="yes" size="small" checked="true" hint="<?= lang('Settings.housekeeping.reset_counts_helper') ?>"><?= lang('Settings.housekeeping.reset_counts') ?></Forms.Toggler>
<Forms.Toggler name="rewrite_media" value="yes" size="small" checked="true" hint="<?= lang('Settings.housekeeping.rewrite_media_helper') ?>"><?= lang('Settings.housekeeping.rewrite_media') ?></Forms.Toggler>
<Forms.Toggler name="clear_cache" value="yes" size="small" checked="true" hint="<?= lang('Settings.housekeeping.clear_cache_helper') ?>"><?= lang('Settings.housekeeping.clear_cache') ?></Forms.Toggler>
<Button variant="primary" type="submit" iconLeft="home-gear"><?= lang('Settings.housekeeping.run') ?></Button>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment