jowy/silex-cache-service-provider

Silex cache provider using doctrine cache

v1.0.0 2015-04-10 07:11 UTC

This package is not auto-updated.

Last update: 2024-04-27 15:37:12 UTC


README

Provide doctrine cache for silex application

Requirement

  • PHP >= 5.5
  • Pimple >= 3.0
  • Doctrine/Cache >= 1.4

Installation

composer require jowy/silex-cache-service-provider

Usage

$container = new Container()
$$container->register(new CacheServiceProvider(), [
            "cache.driver" => "array|filesystem|apc|xcache|redis|memcache|memcached",
            "cache.options" => [
                "namespace" => "your-cache-namespace",
                "directory" => "set-this-if-only-you-select-filesystem-driver",
                "host" => "only-for-redis-memcached-memcache",
                "port" => "only-for-redis-memcached-memcache",
                "password" => "if-any"
            ]
        ]);

$cache = $this->container["cache.factory"];

$this->assertInstanceOf(Cache::class, $cache);

License

MIT, see LICENSE