8000 [FrameworkBundle][Translation] skip warmUp when cache is not used. by aitboudad · Pull Request #14301 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[FrameworkBundle][Translation] skip warmUp when cache is not used. #14301

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

Merged
merged 1 commit into from
Apr 27, 2015
Merged
Changes from all commits
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
5 changes: 5 additions & 0 deletions src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ public function __construct(ContainerInterface $container, MessageSelector $sele
*/
public function warmUp($cacheDir)
{
// skip warmUp when translator doesn't use cache
if (null === $this->options['cache_dir']) {
return;
}

foreach ($this->resourceLocales as $locale) {
$this->loadCatalogue($locale);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this can throw an exception?

In that case, you might want to have a catch block to reset $this->options as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see advantage

}
Expand Down
0