Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 79bea0a

Browse filesBrowse files
committed
feature #9966 added feedback to the cache:clear command (fabpot)
This PR was merged into the 2.5-dev branch. Discussion ---------- added feedback to the cache:clear command simplified version of #9463 | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #9463 | License | MIT | Doc PR | n/a "Especially in production it is sometimes critical to know exactly when your cache is cleared or warmed up. Currently cache:clear provides no feedback whats however. As sites get bigger, so become their cache files. Removing old cache files may sometimes even take minutes. Without any feedback from the cache:clear you do not know the current status. That's why i added more feedback to the cache:clear command that it makes it possible to see when your cache is warmed up and ready to go." Commits ------- f2261da [FrameworkBundle] simplified code a1f6411 [FrameworkBundle] added feedback in cache:clear
2 parents 0af3ca3 + f2261da commit 79bea0a
Copy full SHA for 79bea0a

File tree

Expand file treeCollapse file tree

1 file changed

+14
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+14
-0
lines changed
Open diff view settings
Collapse file

‎src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php‎

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,15 @@ protected function execute(InputInterface $input, OutputInterface $output)
7777
$warmupDir = substr($realCacheDir, 0, -1).'_';
7878

7979
if ($filesystem->exists($warmupDir)) {
80+
if ($output->isVerbose()) {
81+
$output->writeln(' Clearing outdated warmup directory');
82+
}
8083
$filesystem->remove($warmupDir);
8184
}
8285

86+
if ($output->isVerbose()) {
87+
$output->writeln(' Warming up cache');
88+
}
8389
$this->warmup($warmupDir, $realCacheDir, !$input->getOption('no-optional-warmers'));
8490

8591
$filesystem->rename($realCacheDir, $oldCacheDir);
@@ -89,7 +95,15 @@ protected function execute(InputInterface $input, OutputInterface $output)
8995
$filesystem->rename($warmupDir, $realCacheDir);
9096
}
9197

98+
if ($output->isVerbose()) {
99+
$output->writeln(' Removing old cache directory');
100+
}
101+
92102
$filesystem->remove($oldCacheDir);
103+
104+
if ($output->isVerbose()) {
105+
$output->writeln(' Done');
106+
}
93107
}
94108

95109
/**

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.