Skip to content

Commit

Permalink
[FrameworkBundle] removed the --without-debug option for cache:clear …
Browse files Browse the repository at this point in the history
…(it now inherits the debug flag from the parent Kernel)
  • Loading branch information
fabpot committed Jun 8, 2011
1 parent 2d91183 commit 12dd52b
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php
Expand Up @@ -34,15 +34,14 @@ protected function configure()
->setName('cache:clear')
->setDefinition(array(
new InputOption('no-warmup', '', InputOption::VALUE_NONE, 'Do not warm up the cache'),
new InputOption('without-debug', '', InputOption::VALUE_NONE, 'If the cache is warmed up, whether to disable debugging or not'),
))
->setDescription('Clear the cache')
->setHelp(<<<EOF
The <info>cache:clear</info> command clears the application cache for a given environment
and debug mode:
<info>./app/console cache:clear --env=dev</info>
<info>./app/console cache:clear --env=prod --without-debug</info>
<info>./app/console cache:clear --env=prod --no-debug</info>
EOF
)
;
Expand All @@ -65,7 +64,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
} else {
$warmupDir = $realCacheDir.'_new';

$this->warmup(!$input->getOption('without-debug'), $warmupDir);
$this->warmup($warmupDir);

rename($realCacheDir, $oldCacheDir);
rename($warmupDir, $realCacheDir);
Expand All @@ -74,11 +73,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
$this->container->get('filesystem')->remove($oldCacheDir);
}

protected function warmup($debug, $warmupDir)
protected function warmup($warmupDir)
{
$this->container->get('filesystem')->remove($warmupDir);

$kernel = $this->getTempKernel($this->container->get('kernel'), $debug, $warmupDir);
$kernel = $this->getTempKernel($this->container->get('kernel'), $warmupDir);
$kernel->boot();

$warmer = $kernel->getContainer()->get('cache_warmer');
Expand All @@ -95,7 +94,7 @@ protected function warmup($debug, $warmupDir)
}
}

protected function getTempKernel(KernelInterface $parent, $debug, $warmupDir)
protected function getTempKernel(KernelInterface $parent, $warmupDir)
{
$parentClass = get_class($parent);

Expand Down Expand Up @@ -139,6 +138,6 @@ protected function getContainerClass()

$class = "$namespace\\$class";

return new $class($parent->getEnvironment(), $debug);
return new $class($parent->getEnvironment(), $parent->getDebug());

This comment has been minimized.

Copy link
@djpate

djpate Jun 8, 2011

This breaks

php app/console cache:clear

It should be

return new $class($parent->getEnvironment(), $parent->isDebug());
}
}

1 comment on commit 12dd52b

@fabpot
Copy link
Member Author

@fabpot fabpot commented on 12dd52b Jun 8, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed, thanks.

Please sign in to comment.