parizz/cache-bundle

There is no license information available for the latest version (dev-master) of this package.

Parizz CacheBundle

Installs: 82

Dependents: 0

Suggesters: 0

Security: 0

Stars: 3

Watchers: 1

Forks: 1

Open Issues: 0

Type:symfony-bundle

dev-master 2012-05-22 23:14 UTC

This package is auto-updated.

Last update: 2024-03-05 23:23:38 UTC


README

This bundle allows you to configure cache services on top of Doctrine Common Cache :

Using it

You can enable and use Doctrine cache drivers through your project configuration this way :

# app/config/config.yml
parizz_cache:
    drivers:
        my_memcache:
            type: memcache
            host: localhost
            port: 11211
        # A Filsesystem driver is also available
        # (for shared hosted who cannot enable APC, Memcache, etc...)
        foo:
            type: filesystem
            path: /my/filesystem/cache/path

Then, just grab your cache service from the container :

<?php
// Getting the Memcache driver
$cache = $container->get('parizz_cache.my_memcache_driver');

// Storing a value
$cache->save('key', 'value');

// Fetching a value
$value = $cache->fetch('key');