Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[FrameworkBundle] Add a doctrine cache service definition for validator mapping#14429
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
cordoval commentedApr 21, 2015
is this lazyloaded? 👎 This imo should just be documentedhttp://www.craftitonline.com/2015/04/telling-symfony-to-use-cached-validation-from-doctrine-cache-bundle-provider/ |
jakzal commentedApr 22, 2015
@cordoval documenting is not enough imho. We need to provide an upgrade path. |
dunglas commentedJun 15, 2015
👍 |
xabbuh commentedJun 16, 2015
👍 We should just add this to the docs after merging. |
fabpot commentedJun 16, 2015
Can we have the doc PR before merging? |
xabbuh commentedJun 16, 2015
yes, we can (seesymfony/symfony-docs#5409) |
jakzal commentedJun 17, 2015
Any feedback on this one? |
fabpot commentedJun 17, 2015
👍 Does not hurt to have this extra service anyway. Having some other alternatives would be good as well but out of the scope of this PR. |
jakzal commentedJun 22, 2015
Ok then. Let's merge :) |
fabpot commentedJun 23, 2015
Thank you@jakzal. |
…ion for validator mapping (jakzal)This PR was merged into the 2.8 branch.Discussion----------[FrameworkBundle] Add a doctrine cache service definition for validator mapping| Q | A| ------------- | ---| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | -| License | MIT| Doc PR |symfony/symfony-docs#5409Following#12975, this PR only registers a new service so it's possible to use the new doctrine based cache implementation instead of the deprecated one. To use it, the end user would need to configure it in his `config.yml`:```yamlframework: validation: cache: validator.mapping.cache.doctrine.apc```In 3.0 we'll be able to replace the deprecated definition by aliasing `validator.mapping.cache.apc` to `validator.mapping.cache.doctrine.apc`.I thought of automatic wrapping of services which implement doctrine interface, but decided it would be too magic.I'm not convinced if APC is a good default anymore and hope for some discussion. I've used it as it's also used in serializer, and probably translation (see#13986). Since there's a built in opcache in more recent PHP versions, and apcu doesn't seem to be stable, there are better choices. Perhaps a better default would be a filesystem cache (not better performing, but it works anywhere).Commits-------0642911 [FrameworkBundle] Add a doctrine cache service definition for validator mapping
stof commentedJun 25, 2015
@jakzal I think we should also provide an easy way to configure a DoctrineCache wrapping an existing service. This would allow people to configure their cache service thanks to DoctrineCacheBundle (included by default in the SE as it is a dependency of DoctrineBundle), giving them support for any cache backend supported in Doctrine, and then having Frameworkbundle only dealing with configuring the Symfony adapter wrapping it (we could also do this in other places allowing to use doctrine-based cache adapter btw). |
jakzal commentedJun 25, 2015
@stof the only reason why I haven't done this yet is I couldn't decide how to configure it. Would this be acceptable? framework: validation: cache: doctrine: some.doctrine_cache.service So |
…bbuh)This PR was merged into the 2.8 branch.Discussion----------[Reference] document new Doctrine APC cache service| Q | A| ------------- | ---| Doc fix? | no| New docs? | yes (symfony/symfony#14429)| Applies to | 2.8+| Fixed tickets |Commits-------485c8a0 document new Doctrine APC cache service
Following#12975, this PR only registers a new service so it's possible to use the new doctrine based cache implementation instead of the deprecated one. To use it, the end user would need to configure it in his
config.yml:In 3.0 we'll be able to replace the deprecated definition by aliasing
validator.mapping.cache.apctovalidator.mapping.cache.doctrine.apc.I thought of automatic wrapping of services which implement doctrine interface, but decided it would be too magic.
I'm not convinced if APC is a good default anymore and hope for some discussion. I've used it as it's also used in serializer, and probably translation (see#13986). Since there's a built in opcache in more recent PHP versions, and apcu doesn't seem to be stable, there are better choices. Perhaps a better default would be a filesystem cache (not better performing, but it works anywhere).