Selfupgrade command now clears cache after a successful upgrade

This commit is contained in:
Djamil Legato
2014-10-12 18:54:27 -07:00
parent 523b6376bb
commit 48b02b0f05
2 changed files with 13 additions and 0 deletions

View File

@@ -2,7 +2,9 @@
namespace Grav\Console;
use Grav\Common\GravTrait;
use Grav\Console\Cli\ClearCacheCommand;
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
use Symfony\Component\Console\Input\ArrayInput;
trait ConsoleTrait
{
@@ -61,4 +63,11 @@ trait ConsoleTrait
exit;
}
}
public function clearCache()
{
$command = new ClearCacheCommand();
$input = new ArrayInput(array('--all' => true));
return $command->run($input, $this->output);
}
}

View File

@@ -7,6 +7,7 @@ use Grav\Common\GPM\Installer;
use Grav\Common\GPM\Response;
use Grav\Console\ConsoleTrait;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
@@ -114,6 +115,9 @@ class SelfupgradeCommand extends Command
$this->output->writeln(" '- <green>Success!</green> ");
$this->output->writeln('');
}
// clear cache after successful upgrade
$this->clearCache();
}
private function download($package)