8000 [FrameworkBundle][Translation][warmUp] use tmp cacheDir. · symfony/symfony@48f5253 · GitHub
[go: up one dir, main page]

Skip to content

Commit 48f5253

Browse files
committed
[FrameworkBundle][Translation][warmUp] use tmp cacheDir.
1 parent 1e121e6 commit 48f5253

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,18 @@ 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+
85+
$currentDir = $this->options['cache_dir'];
86+
$this->options['cache_dir'] = $cacheDir;
8087
foreach ($this->resourceLocales as $locale) {
8188
$this->loadCatalogue($locale);
8289
}
90+
91+
$this->options['cache_dir'] = $currentDir;
8392
}
8493

8594
/**

0 commit comments

Comments
 (0)
0