Skip to content

Commit f85ba5d

Browse files
committed
bug #14301 [FrameworkBundle][Translation] skip warmUp when cache is not used. (aitboudad)
This PR was merged into the 2.7 branch. Discussion ---------- [FrameworkBundle][Translation] skip warmUp when cache is not used. | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Fixed tickets | #13942 | Tests pass? | yes | License | MIT Commits ------- efb10f6 [FrameworkBundle][Translation] skip warmUp when cache is not used.
2 parents a1f7fb3 + efb10f6 commit f85ba5d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ public function __construct(ContainerInterface $container, MessageSelector $sele
7777
*/
7878
public function warmUp($cacheDir)
7979
{
80+
// skip warmUp when translator doesn't use cache
81+
if (null === $this->options['cache_dir']) {
82+
return;
83+
}
84+
8085
foreach ($this->resourceLocales as $locale) {
8186
$this->loadCatalogue($locale);
8287
}

0 commit comments

Comments
 (0)