itinance/doctrine-cache-adapter-with-site-context

There is no license information available for the latest version (v0.3) of this package.
Maintainers

👁 itinance

Package info

github.com/itinance/doctrine-cache-adapter-with-site-context

pkg:composer/itinance/doctrine-cache-adapter-with-site-context

Statistics

Installs: 14

Dependents: 0

Suggesters: 1

Stars: 1

Open Issues: 0

v0.3 2017-04-03 20:43 UTC

Requires (Dev)

None

Suggests

None

Provides

None

Conflicts

None

Replaces

None

Unknown License a65bbdd4f89cc6864e97d9b3062210ed1db0365e

  • hagen huebel <hhuebel.woop@itinance.com>

This package is not auto-updated.

Last update: 2026-06-21 02:46:40 UTC


README

If you are using Emanuele Minottos 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 ] ]