PHPackages                             beryllium/silex-cache-provider - 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. beryllium/silex-cache-provider

AbandonedLibrary[Caching](/categories/caching)

beryllium/silex-cache-provider
==============================

A cache provider for Silex, supporting Memcache, APC, and file-based caching.

1.0(12y ago)77441MITPHPPHP &gt;5.3.8

Since Nov 28Pushed 9y ago1 watchersCompare

[ Source](https://github.com/beryllium/silex-cache-provider)[ Packagist](https://packagist.org/packages/beryllium/silex-cache-provider)[ RSS](/packages/beryllium-silex-cache-provider/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Silex Cache Provider
====================

[](#silex-cache-provider)

SilexCacheProvider is configurable to provide client interfaces for Memcache, APC, or a file-based cache.

Installation
------------

[](#installation)

Run `composer require beryllium/silex-cache-provider` or add to your composer.json:

```
"require": {
    "beryllium/silex-cache-provider": "*"
}

```

Currently, the provider is only available with a minimum stability of "dev".

Configuration
-------------

[](#configuration)

### Memcache

[](#memcache)

Register the provider using Memcache (requires installation of the PHP memcache extension):

```
$app->register(
    new Beryllium\SilexCacheProvider\SilexCacheProvider(),
    array(
        'be_cache.type' => 'memcache',
        'be_cache.host' => '127.0.0.1',
        'be_cache.port' => 11211,
    )
);

```

The above settings are the provider defaults, so you can actually just do the following if that is your configuration:

```
$app->register(new Beryllium\SilexCacheProvider\SilexCacheProvider());

```

### File Cache

[](#file-cache)

This option requires a local folder with write access. The be\_cache service will use the folder to store serialized data from PHP.

```
$app->register(
    new Beryllium\SilexCacheProvider\SilexCacheProvider(),
    array(
        'be_cache.type' => 'filecache',
        'be_cache.path' => __DIR__ . '/cache'
    )
);

```

### APC Cache

[](#apc-cache)

This option requires the APC extension to be active.

```
$app->register(
    new Beryllium\SilexCacheProvider\SilexCacheProvider(),
    array(
        'be_cache.type' => 'apc'
    )
);

```

Usage
-----

[](#usage)

Three methods are exposed by the cache service. Set, Get, and Delete.

### Set

[](#set)

This method takes three parameters: Key Name, Data, and Time-To-Live (in seconds).

To store the variable $data for 5 minutes, you would use:

```
$app['be_cache']->set('key_name', $data, 300);

```

### Get and Delete

[](#get-and-delete)

These methods only take one parameter: Key Name.

```
$data = $app['be_cache']->get('key_name');
// ...
$app['be_cache']->delete('key_name');

```

Additional Tips
---------------

[](#additional-tips)

### Prefix

[](#prefix)

You may want to share your Memcache instance with other processes. In this scenario, you would want to namespace all of your application's keys so they won't conflict.

This can be done by specifying a prefix in your settings at registration:

```
'be_cache.prefix' => 'example_prefix|';

```

### Get Client

[](#get-client)

You can retrieve the client from the service two ways:

```
$client = $app['be_cache.client'];
// or
$client = $app['be_cache']->getClient();

```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4597d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/602491?v=4)[Kevin Boyd](/maintainers/beryllium)[@beryllium](https://github.com/beryllium)

---

Top Contributors

[![beryllium](https://avatars.githubusercontent.com/u/602491?v=4)](https://github.com/beryllium "beryllium (4 commits)")

### Embed Badge

![Health badge](/badges/beryllium-silex-cache-provider/health.svg)

```
[![Health](https://phpackages.com/badges/beryllium-silex-cache-provider/health.svg)](https://phpackages.com/packages/beryllium-silex-cache-provider)
```

###  Alternatives

[chh/cache-service-provider

Provides easy to use caching for Silex applications, built on top of the doctrine/cache package

23163.8k1](/packages/chh-cache-service-provider)[beryllium/cachebundle

Provides an interface to Memcache for Symfony2 applications

32136.0k](/packages/beryllium-cachebundle)

PHPackages © 2026

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