Skip to content

Commit

Permalink
Updated the styles for the "cache:warmup" command
Browse files Browse the repository at this point in the history
  • Loading branch information
javiereguiluz committed Sep 28, 2015
1 parent 08b2959 commit 44c5416
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -14,6 +14,7 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;

/**
* Warmup the cache.
Expand Down Expand Up @@ -53,8 +54,10 @@ protected function configure()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$output = new SymfonyStyle($input, $output);

$kernel = $this->getContainer()->get('kernel');
$output->writeln(sprintf('Warming up the cache for the <info>%s</info> environment with debug <info>%s</info>', $kernel->getEnvironment(), var_export($kernel->isDebug(), true)));
$output->comment(sprintf('Warming up the cache for the <info>%s</info> environment with debug <info>%s</info>', $kernel->getEnvironment(), var_export($kernel->isDebug(), true)));

$warmer = $this->getContainer()->get('cache_warmer');

Expand All @@ -63,5 +66,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
}

$warmer->warmUp($this->getContainer()->getParameter('kernel.cache_dir'));

$output->success(sprintf('Cache for the "%s" environment (debug=%s) was succesfully warmed.', $kernel->getEnvironment(), var_export($kernel->isDebug(), true)));
}
}

0 comments on commit 44c5416

Please sign in to comment.