From feead36ca8c06757900b1196937d8ab928d813d5 Mon Sep 17 00:00:00 2001 From: Thomas Steur <thomas.steur@googlemail.com> Date: Sun, 7 Sep 2014 19:41:28 +0200 Subject: [PATCH] refs #6133 added a command to clear all caches --- CHANGELOG.md | 7 ++-- plugins/CoreConsole/Commands/ClearCaches.php | 37 ++++++++++++++++++++ 2 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 plugins/CoreConsole/Commands/ClearCaches.php diff --git a/CHANGELOG.md b/CHANGELOG.md index ae84cc3597..06cd5f970c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,9 @@ This is a changelog for Piwik platform developers. All changes for our HTTP API' ### New APIs * It is now easier to generate the URL for a menu item see [#6140](https://github.com/piwik/piwik/issues/6140), [urlForDefaultAction()](http://developer.piwik.org/api-reference/Piwik/Plugin/Menu#urlfordefaultaction), [urlForAction()](http://developer.piwik.org/api-reference/Piwik/Plugin/Menu#urlforaction), [urlForModuleAction()](http://developer.piwik.org/api-reference/Piwik/Plugin/Menu#urlformoduleaction) +### New commands +* `core:clear-caches` Lets you easily delete all caches. This command can be useful for instance after updating Piwik files manually. + ## Piwik 2.6.0 @@ -75,7 +78,7 @@ We are using `@since` annotations in case we are introducing new API's to make i * [MenuUser](http://developer.piwik.org/api-reference/Piwik/Menu/MenuUser) to add or modify user menu items * [Tasks](http://developer.piwik.org/api-reference/Piwik/Plugin/Tasks) to add scheduled tasks -### New commmands +### New commands * `generate:theme` Let's you easily generate a new theme and customize colors, see the [Theming guide](http://developer.piwik.org/guides/theming) * `generate:update` Let's you generate an update file * `generate:report` Let's you generate a report @@ -93,7 +96,7 @@ We are using `@since` annotations in case we are introducing new API's to make i ### Deprecations ### New features ### New APIs -### New commmands +### New commands ### New guides ### Internal change --> diff --git a/plugins/CoreConsole/Commands/ClearCaches.php b/plugins/CoreConsole/Commands/ClearCaches.php new file mode 100644 index 0000000000..cb199c8545 --- /dev/null +++ b/plugins/CoreConsole/Commands/ClearCaches.php @@ -0,0 +1,37 @@ +<?php +/** + * Piwik - free/libre analytics platform + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + * + */ + +namespace Piwik\Plugins\CoreConsole\Commands; + +use Piwik\Filesystem; +use Piwik\Plugin\ConsoleCommand; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; + +/** + */ +class ClearCaches extends ConsoleCommand +{ + protected function configure() + { + $this->setName('core:clear-caches'); + $this->setDescription('Deletes all caches. This command can be useful for instance after updating Piwik files manually.'); + } + + /** + * Execute command like: ./console core:clear-caches + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + Filesystem::deleteAllCacheOnUpdate(); + + $this->writeSuccessMessage($output, array('Caches cleared')); + } +} -- GitLab