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

Fix DI configuration to allow cache_provider key in cache_driver of type provider #1124

Conversation

MortalFlesh
Copy link

Hey,

I'm trying to update to version ^2.0 and the installation is failing, because I'm using a cache providers.

My simplified doctrine_cache configuration looks like this:

doctrine_cache:
    providers:
        data: ...

In the version ^1.0 I have orm configuration:

...
    second_level_cache:
        region_cache_driver:
            cache_provider: data
        regions:
            # this region is here because of the bug https://github.com/doctrine/DoctrineBundle/issues/81
            special_region:
                cache_driver:
                    cache_provider: data
...

I figured that it should be like this in version ^2.0

...
    second_level_cache:
        region_cache_driver:
            type: provider
            cache_provider: data
        regions:
            special_region:
                cache_driver:
                    type: provider
                    cache_provider: data
...

BUT this doesn't work, since cache_provider key is not allowed in cache_driver configuration, but it is also required in the https://github.com/doctrine/DoctrineBundle/blob/master/DependencyInjection/DoctrineExtension.php#L736-L738 .

So I've added the scalar_node for cache_provider to fix the situation, I hope it is correct.

I guess for now it could be bypassed by following:

cache_driver:
    type: service
    id: doctrine_cache.providers.data

@alcaeus
Copy link
Member

alcaeus commented Jan 9, 2020

It's not required, this was merely left over from the cleanup. Fact is that using type: provider is no longer supported. DoctrineBundle 2.0 only supports type: pool and type: service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants