bru2s / cache-service-provider
Modyfication of dafiti/cache-service-provider. Filesystems support added.
Installs: 407
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 4
pkg:composer/bru2s/cache-service-provider
Requires
- php: >=5.4.0
- doctrine/cache: v1.4.0
- silex/silex: ~1.1
Requires (Dev)
- fabpot/php-cs-fixer: @stable
- phpunit/phpunit: @stable
This package is not auto-updated.
Last update: 2026-01-21 17:32:55 UTC
README
A Silex Service Provider for Doctrine Cache.
Instalation
{
"require": {
"bru2s/cache-service-provider": "dev-master"
}
}
Adapters Availables
To use Memcache
sudo apt-get install php5-memcached
To use Memcached
sudo apt-get install php5-memcached
To use Redis Adapter install PHPRedis
git clone git@github.com:phpredis/phpredis.git
cd phpredis
phpize
./configure
make && make install
Usage
use Silex\Application; use Bru2s\Silex\CacheServiceProvider; $app = new Application(); $app['config'] = [ 'cache' => [ 'adapter' => 'Memcache', 'host' => '127.0.0.1', 'port' => 11211, 'connectable' => true // If not need of one connection put FALSE (in Filesystem must be FALSE) ] ]; $app->register(new CacheServiceProvider()); $app['cache']->save('your-key', 'your-data'); $data = $app['cache']->fetch('your-key'); echo $data; // your-data
License
MIT License