Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Translator] Config cache_dir #32542

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

Closed
Raulnet opened this issue Jul 14, 2019 · 0 comments
Closed

[Translator] Config cache_dir #32542

Raulnet opened this issue Jul 14, 2019 · 0 comments

Comments

@Raulnet
Copy link
Contributor

Raulnet commented Jul 14, 2019

**Symfony version(s) 3.4, 4.3

Description
the cache directory of Translator can not be change in default config

Possible Solution

add this config in
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

// src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

class FrameworkExtension extends Extension {
...
 private function registerTranslatorConfiguration(array $config, ContainerBuilder $container, LoaderInterface $loader) {
...
    if (\array_key_exists('cache_dir', $config)) {
            $defaultOptions = $translator->getArgument(4);
            $defaultOptions += ['cache_dir' => $config['cache_dir']];
            $translator->setArgument(4, $defaultOptions);
        }
    }
...
}
@fabpot fabpot closed this as completed Aug 4, 2019
fabpot added a commit that referenced this issue Aug 4, 2019
…lnet)

This PR was submitted for the 4.3 branch but it was squashed and merged into the 4.4 branch instead (closes #32543).

Discussion
----------

[FrameworkBundle] add config translator cache_dir

| Q             | A
| ------------- | ---
| Branch?       |  4.4 (be careful when merging)
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #32542
| License       | MIT

Now the parameter cache_dir of Translator constructor can be change or disable on config

```yaml
#framework.yaml
framework:
    ...
    translator:
        cache_dir: null #(cache disable)
    ...
```

Commits
-------

7613c7d [FrameworkBundle] add config translator cache_dir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants