Skip to content

Instantly share code, notes, and snippets.

@carteni
Created February 7, 2017 08:42
Show Gist options
  • Save carteni/53ffe5e2fbac4321ede9ae0efb993cc8 to your computer and use it in GitHub Desktop.
Save carteni/53ffe5e2fbac4321ede9ae0efb993cc8 to your computer and use it in GitHub Desktop.
Symfony Validation / Caching ClassMetadata information using Predis.
framework:
validation: { enable_annotations: true, cache: validator.mapping.cache.doctrine.predis_cache }
services:
# $ composer require predis/predis ^1.0
predis_client:
class: Predis\Client
public: false
cache.doctrine.predis_cache:
class: Doctrine\Common\Cache\PredisCache
public: false
arguments: ["@predis_client"]
calls:
- [setNamespace, ["%validator.mapping.cache.prefix%"]]
validator.mapping.cache.doctrine.predis_cache:
class: Symfony\Component\Validator\Mapping\Cache\DoctrineCache
public: false
arguments: ["@cache.doctrine.predis_cache"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment