Skip to content

How to specify the doctrine cache for the validation #12803

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
cmodijk opened this issue Dec 2, 2014 · 0 comments
Closed

How to specify the doctrine cache for the validation #12803

cmodijk opened this issue Dec 2, 2014 · 0 comments
Labels

Comments

@cmodijk
Copy link

cmodijk commented Dec 2, 2014

In the symfony standaard installation this comment stil exists but the symfony framework bundle still loads the deprecated ApcCache class. And I can't find how to specify the doctrine cache service id.

#framework:
#    validation:
#        cache: apc
@fabpot fabpot added the Doctrine label Dec 7, 2014
fabpot added a commit that referenced this issue Dec 24, 2014
…ing cache. (jakzal)

This PR was merged into the 2.5 branch.

Discussion
----------

[FrameworkBundle] Allow custom services for validator mapping cache.

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #12803
| License       | MIT
| Doc PR        | -

#9892 introduced `DoctrineCache`, but it's not really used by the FrameworkBundle. This was overlooked, therefore I think it should go into 2.5.

This PR will let us to configure a service id, instead of a driver name. The only exception is apc, which is converted to `validator.mapping.cache.apc` to keep BC.

Examples:

```yaml
framework:
    validation:
        cache: apc # converted to validator.mapping.cache.apc
```

```yaml
framework:
    validation:
        cache: my_custom_cache_service
```

It would be nice to be able to provide a doctrine service id, instead of `CacheInterface` implementation. It could be automatically decorated with `DoctrineCache`:

```yaml
framework:
    validation:
        cache:
            doctrine: my_doctrine_cache_service # could be provided by DoctrineCacheBundle
```

I'll work on it next.

Commits
-------

4cdcf10 [FrameworkBundle] Allow custom services for validator mapping cache.
@fabpot fabpot closed this as completed Dec 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants