https://github.com/itinance/doctrine-cache-adapter-with-site-context
CacheAdapter as a bridge between TwigCacheBundle and WhiteLabelBundle
https://github.com/itinance/doctrine-cache-adapter-with-site-context
Last synced: about 1 year ago
JSON representation
CacheAdapter as a bridge between TwigCacheBundle and WhiteLabelBundle
- Host: GitHub
- URL: https://github.com/itinance/doctrine-cache-adapter-with-site-context
- Owner: itinance
- License: mit
- Created: 2015-09-12T21:02:42.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-04-03T20:48:01.000Z (about 9 years ago)
- Last Synced: 2024-10-29T11:29:33.094Z (over 1 year ago)
- Language: PHP
- Size: 3.91 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DoctrineCacheAdapterWithSiteContext
If you are using Emanuele Minottos [TwigCacheBundle](https://github.com/EmanueleMinotto/TwigCacheBundle) and
Simon Ochos white-label-bundle (https://github.com/simonoche/white-label-bundle), you will get trouble with
the cache.
This class is a replacement for the Cache Adapter used in TwigCacheBundle, to respect the current site context
in a white-label / multi-site environment.
## Installation:
Installation using composer:
```
"repositories": [
{
"type": "git",
"url": "git@github.com:itinance/DoctrineCacheAdapterWithSiteContext.git"
}
],
"require": {
"itinance/DoctrineCacheAdapterWithSiteContext": "dev-master"
},
```
## Configuration
in app/config/services.yml add the following
```
twig_cache.adapter:
class: itinance\DoctrineCacheAdapterWithSiteContext
arguments:
- @cache_service
- @site_context
```
@cache_service could be configured like this:
```
memcached:
class: Memcached
calls:
- [ addServers, [ %memcached.servers% ] ]
cache_service:
class: Doctrine\Common\Cache\MemcachedCache
calls:
- [ setMemcached, [ @memcached ] ]
```