8000 Feedback in cache:clear by jrmyio · Pull Request #9463 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Feedback in cache:clear #9463

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Feedback in cache:clear
  • Loading branch information
jrmyio committed Nov 7, 2013
commit 2e0b6657d8fbd3b29eef25645585e4436f3e4535
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
}

$kernel = $this->getContainer()->get('kernel');
$output->writeln(sprintf('Clearing the cache for the <info>%s</info> environment with debug <info>%s</info>', $kernel->getEnvironment(), var_export($kernel->isDebug(), true)));
$output->writeln(sprintf('Clearing the cache for the <info>%s</info> environment with debug <info>%s</info>:', $kernel->getEnvironment(), var_export($kernel->isDebug(), true)));
$this->getContainer()->get('cache_clearer')->clear($realCacheDir);

if ($input->getOption('no-warmup')) {
Expand All @@ -77,19 +77,24 @@ protected function execute(InputInterface $input, OutputInterface $output)
$warmupDir = substr($realCacheDir, 0, -1).'_';

if ($filesystem->exists($warmupDir)) {
$output->writeln('Clearing outdated warmup directory...');
$filesystem->remove($warmupDir);
}

$output->writeln('Warming up cache...');
$this->warmup($warmupDir, $realCacheDir, !$input->getOption('no-optional-warmers'));

$filesystem->rename($realCacheDir, $oldCacheDir);
if (defined('PHP_WINDOWS_VERSION_BUILD')) {
sleep(1); // workaround for windows php rename bug
}
$filesystem->rename($warmupDir, $realCacheDir);
$output->writeln('Warm up completed...');
}

$output->writeln('Removing old cache directory...');
$filesystem->remove($oldCacheDir);
$output->writeln('Completed clearing cache' . ($input->getOption('no-warmup') ? " ." : " and warmup."));
}

/**
Expand Down
0