phpro / annotated-cache-bundle
Provides a Symfony bridge for the phpro/annotated-cache package
Installs: 6 739
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 5
Forks: 1
Open Issues: 0
Requires
- php: ~7.0
- phpro/annotated-cache: ~0.2
- symfony/dependency-injection: ^3.0|^2.8
- symfony/http-kernel: ^3.0|^2.8
- symfony/web-profiler-bundle: ^3.0|^2.8
Requires (Dev)
Suggests
- cache/cache: This package provides a set of PSR6 pool adapters and a taggable implementation.
This package is auto-updated.
Last update: 2020-12-22 10:24:05 UTC
README
Repository abandoned 2020-11-27
This repository has been archived since we are not using it anymore internally. Feel free to use it AS-IS, we won't be providing any support anymore.
Annotated Cache bundle
Installation
composer require phpro/annotated-cache-bundle
# AppKernel.php public function registerBundles() { $bundles = [ // Bundles .... new Phpro\AnnotatedCacheBundle\AnnotatedCacheBundle(), ]; return $bundles; }
Note: If you want to use cached services with multiple tags, it's recommended to register this bundle as early as possible.
Configuration
# Default configuration for extension with alias: "annotated_cache" annotated_cache: key_generator: phpro.annotated_cache.keygenerator.expressions proxy_config: cache_dir: '%kernel.cache_dir%/annotated_cache' namespace: AnnotatedCacheGeneratedProxy register_autoloader: true pools: # Example: poolname: service: service.key
Generate proxies
services: app.manager.products: class: App\Manager\ProductsManager tags: - { name: 'annotated_cache.eligable' }
You can register your own services to use a caching proxy instead.
The only thing you will have to do is to tag your service with the annotated_cache.eligable
tag.
Configure your own interceptor
services: app.interceptor.my_interceptor: class: App\Interceptor\MyInterceptor tags: - { name: 'annotated_cache.interceptor' }
Adding your own functionality is easy.
Create your own InterceptorInterface
and tag it with the annotated_cache.interceptor
tag.