Download the PHP package euskadi31/cache-service-provider without Composer
On this page you can find all versions of the php package euskadi31/cache-service-provider. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download euskadi31/cache-service-provider
More information about euskadi31/cache-service-provider
Files in euskadi31/cache-service-provider
Package cache-service-provider
Short Description A Cache Service Provider for Silex 2.0, using the doctrine/cache package
License MIT
Informations about the package cache-service-provider
Silex Cache Service Provider
This service provider for Silex 2.0 uses the Cache classes from Doctrine Common to provide a cache service to a Silex application, and other service providers.
Install
Add euskadi31/cache-service-provider
to your composer.json
:
% php composer.phar require euskadi31/cache-service-provider:~1.0
Usage
Configuration
If you only need one application wide cache, then it's sufficient to
only define a default cache, by setting the default
key in cache.options
.
The cache definition is an array of options, with driver
being the
only mandatory option. All other options in the array, are treated as
constructor arguments to the driver class.
The cache named default
is the cache available through the app's
cache
service.
The driver name can be either:
- A fully qualified class name
- A simple identifier like "apc", which then gets translated to
\Doctrine\Common\Cache\ApcCache
. - A Closure, which returns an object implementing
\Doctrine\Common\Cache\Cache
.
This cache is then available through the cache
service, and provides
an instance of Doctrine\Common\Cache\Cache
:
To configure multiple caches, define them as additional keys in cache.options
:
All caches (including the default) are then available via the caches
service:
License
CacheServiceProvider is licensed under the MIT license.