Skip to content
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

cache_dir config is enforced #60

Open
Nek- opened this issue Jul 9, 2020 · 0 comments
Open

cache_dir config is enforced #60

Nek- opened this issue Jul 9, 2020 · 0 comments

Comments

@Nek-
Copy link

Nek- commented Jul 9, 2020

Hello,

I wanted an idempotent cache but the translator uses the cache dynamically. In Symfony you can redefine the cache_dir in configuration, but this configuration is ignored by this bundle and overrided to the default cache directory.

I used this code as a workaround that will not work with the master branch of the bundle:

class IdempotentCachePass implements CompilerPassInterface
{
    public function process(ContainerBuilder $container): void
    {
        $definition = $container->getDefinition('sylius.theme.translation.translator');
        $defaultOptions = $definition->getArgument(4);
        $defaultOptions['cache_dir'] = $container->getParameter('kernel.tmp_dir');
        $definition->setArgument(4, $defaultOptions);
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant