Skip to content

Commit

Permalink
Fixes #6383 Invalidate caches before running the upgrade.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattab committed Oct 6, 2014
1 parent 092fda6 commit eb25aea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions plugins/CoreConsole/Commands/ClearCaches.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ protected function configure()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
// Note: the logic for this command must be refactored in this helper function below.
Filesystem::deleteAllCacheOnUpdate();

$this->writeSuccessMessage($output, array('Caches cleared'));
Expand Down
8 changes: 8 additions & 0 deletions plugins/CoreUpdater/Commands/Update.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/
namespace Piwik\Plugins\CoreUpdater\Commands;

use Piwik\Filesystem;
use Piwik\Plugin\ConsoleCommand;
use Piwik\Plugins\CoreUpdater\Controller;
use Piwik\Plugins\CoreUpdater\NoUpdatesFoundException;
Expand Down Expand Up @@ -35,6 +36,8 @@ protected function configure()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->executeClearCaches();

$doDryRun = (bool) $input->getOption('dry-run');

try {
Expand All @@ -54,6 +57,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
}
}

protected function executeClearCaches()
{
Filesystem::deleteAllCacheOnUpdate();
}

protected function makeUpdate(InputInterface $input, OutputInterface $output, $doDryRun)
{
$this->checkAllRequiredOptionsAreNotEmpty($input);
Expand Down

0 comments on commit eb25aea

Please sign in to comment.