8000 bug #23328 [FrameworkBundle] Display a proper warning on cache:clear … · symfony/symfony@8b6cb57 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8b6cb57

Browse files
committed
bug #23328 [FrameworkBundle] Display a proper warning on cache:clear without the --no-warmup option (ogizanagi)
This PR was merged into the 3.3 branch. Discussion ---------- [FrameworkBundle] Display a proper warning on cache:clear without the --no-warmup option | Q | A | ------------- | --- | Branch? | 3.3 <!-- see comment below --> | Bug fix? | no | New feature? | no <!-- don't forget updating src/**/CHANGELOG.md files --> | BC breaks? | no | Deprecations? | no <!-- don't forget updating UPGRADE-*.md files --> | Tests pass? | yes | Fixed tickets | symfony/recipes#105 and others reports related to cache warming issues with final/custom kernel classes <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | N/A I'd suggest to simply make this more obvious for everyone, as the deprecation is only shown when executing the command with `-vv` or by inspecting logs otherwise: <img width="970" alt="screenshot 2017-06-29 a 20 08 21" src="https://user-images.githubusercontent.com/2211145/27703182-db734150-5d06-11e7-9306-f5837bf240ed.PNG"> Commits ------- 6cd188b [FrameworkBundle] Display a proper warning on cache:clear without the --no-warmup option
2 parents 7093fc1 + 6cd188b commit 8b6cb57

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
7777
if ($input->getOption('no-warmup')) {
7878
$filesystem->rename($realCacheDir, $oldCacheDir);
7979
} else {
80-
@trigger_error('Calling cache:clear without the --no-warmup option is deprecated since version 3.3. Cache warmup should be done with the cache:warmup command instead.', E_USER_DEPRECATED);
80+
$warning = 'Calling cache:clear without the --no-warmup option is deprecated since version 3.3. Cache warmup should be done with the cache:warmup command instead.';
81+
82+
@trigger_error($warning, E_USER_DEPRECATED);
83+
84+
$io->warning($warning);
8185

8286
$this->warmupCache($input, $output, $realCacheDir, $oldCacheDir);
8387
}

0 commit comments

Comments
 (0)
0