PHPackages                             tarjei/memcachebundle - 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. tarjei/memcachebundle

AbandonedArchivedSymfony-bundle

tarjei/memcachebundle
=====================

Bundle for using memcached with symfony

226.5k5[2 PRs](https://github.com/tarjei/MemcacheBundle/pulls)PHP

Since Aug 28Pushed 3y ago1 watchersCompare

[ Source](https://github.com/tarjei/MemcacheBundle)[ Packagist](https://packagist.org/packages/tarjei/memcachebundle)[ RSS](/packages/tarjei-memcachebundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

\# DEPRECATED

This project is no longer beeing developed.

MemcacheBundle
--------------

[](#memcachebundle)

This is a simple bundle that creates a memcached service that you can use.

Note: The service supports creating both PHP Memcache extensions (i.e. both  and ), BUT it does not protect you from differences in the two services interfaces as it returns the raw object.

### Instalation

[](#instalation)

Add to deps:

```
[SMMemcacheBundle]
    git=git://github.com/tarjei/MemcacheBundle.git
    target=/bundles/SM/MemcacheBundle
```

Then register the bundle with your kernel:

```
// app/AppKernel.php
// in AppKernel::registerBundles()
$bundles = array(
    // ...
    new SM\MemcacheBundle\SMMemcacheBundle(),
    // ...
);
```

Make sure that you also register the namespaces with the autoloader:

```
// app/autoload.php
$loader->registerNamespaces(array(
    // ...
    'SM\\MemcacheBundle' => __DIR__ . '/../vendor/bundles',
));
```

### Configuration

[](#configuration)

In your prod/dev environment:

```
# app/config/config.yml
sm_memcache:
    use_mock: false
    port: 11211
    host: localhost
```

In your test environment:

```
# app/config/config.yml
sm_memcache:
    use_mock: true
```

### Usage

[](#usage)

The service is named sm\_memcache, it returns a normal Memcache or Memcached php object:

```
$memcached = $container->get("sm_memcache");
$memcached->set("someKey", "somevalue");
```

The service is just the normal Memcache object () so you can use the normal methods.

For tests there is a special MockMemcache object that you can use to stub out the memcache service.

### Options

[](#options)

If you use Memcached class, you can pass options to instance in config. Example:

```
sm_memcache:
    port: 11211
    host: localhost
    class: Memcached
    options:
        igbinary:
            name: serializer
            value: serializer_igbinary
```

This example sets Memcached::OPT\_SERIALIZER to Memcached::SERIALIZER\_IGBINARY Before applying options are converted in following format:

- option name is converted to Memcached::OPT\_\*UPPERCASE\_NAME\* constant
- option value is converted to Memcached::\*UPPERCASE\_NAME\*

If you use Memcache class, options block is ignored.

### TODO

[](#todo)

> - Support multiple memcache servers.
> - Support more methods in the mock module.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/b1cd4ef49c989e7df8c5db0c55dca081dbe0a50f5af8fadc494b27fafb602d39?d=identicon)[tarjei](/maintainers/tarjei)

---

Top Contributors

[![tarjei](https://avatars.githubusercontent.com/u/211263?v=4)](https://github.com/tarjei "tarjei (4 commits)")[![mente](https://avatars.githubusercontent.com/u/391997?v=4)](https://github.com/mente "mente (3 commits)")[![COil](https://avatars.githubusercontent.com/u/177844?v=4)](https://github.com/COil "COil (2 commits)")[![francisbesset](https://avatars.githubusercontent.com/u/471525?v=4)](https://github.com/francisbesset "francisbesset (1 commits)")[![rdohms](https://avatars.githubusercontent.com/u/94331?v=4)](https://github.com/rdohms "rdohms (1 commits)")

### Embed Badge

![Health badge](/badges/tarjei-memcachebundle/health.svg)

```
[![Health](https://phpackages.com/badges/tarjei-memcachebundle/health.svg)](https://phpackages.com/packages/tarjei-memcachebundle)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
