This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Bundle/FrameworkBundle/Resources
Fabien Potencier dd7583d485 feature #14429 [FrameworkBundle] Add a doctrine cache service definition 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        | https://github.com/symfony/symfony-docs/pull/5409

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`:

```yaml
framework:
    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
2015-06-23 13:43:04 +02:00
..
config feature #14429 [FrameworkBundle] Add a doctrine cache service definition for validator mapping (jakzal) 2015-06-23 13:43:04 +02:00
meta Updated copyright to 2015 2015-01-01 13:56:52 +01:00
public WebProfiler break words 2015-05-16 15:40:55 +02:00
views [Form] Added the 'range' FormType 2015-06-17 10:08:53 +02:00