PHPackages                             werkint/memcached-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. werkint/memcached-bundle

AbandonedLibrary[Caching](/categories/caching)

werkint/memcached-bundle
========================

Bundle providing Memcached (namespaced) for services via tags

1.0.0(12y ago)154ownPHPPHP &gt;=5.4

Since Jun 30Pushed 12y ago1 watchersCompare

[ Source](https://github.com/Werkint/MemcachedBundle)[ Packagist](https://packagist.org/packages/werkint/memcached-bundle)[ RSS](/packages/werkint-memcached-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

MemcachedBundle
===============

[](#memcachedbundle)

Bundle providing Memcached (namespaced) for services via tags
=============================================================

[](#bundle-providing-memcached-namespaced-for-services-via-tags)

This bundle allows separation of services with namespaces. You tag each service which use Memcached, so when the container is being compiled, each service get an instance of doctrine cache provider with corresponding namespace set. Also this bundle helps store sessions in namespaces.

Also notice, that full namespace for services would be something like "company\_dev\_theservice\_", so you even can have multiple instances of project running on the machine at the same time.

### Configuration

[](#configuration)

```
framework:
    ...
    session:
        handler_id: werkint.memcached.session
werkint_memcached:
    host:   localhost
    port:   11211
    prefix: company_%kernel.environment%
    session:
        prefix: company_%kernel.environment%_sess
        expire: 3600
```

### Adding tagged services (namespace: "theservice")

[](#adding-tagged-services-namespace-theservice)

```
services:
    company.service:
        class: Company\MainBundle\Service\Service
        arguments:
            ...
            - @werkint.memcached.ns.theservice
        tags:
            - { name: werkint.memcached.cacher, ns: theservice }

```

```
