dafiti / cache-service-provider
A Silex Service Provider for Doctrine Cache
This package's canonical repository appears to be gone and the package has been frozen as a result.
0.0.3
2015-05-14 19:04 UTC
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: 2021-06-11 23:29:49 UTC
README
A Silex Service Provider for Doctrine Cache.
Instalation
{ "require": { "dafiti/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 Dafiti\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 ] ]; $app->register(new CacheServiceProvider()); $app['cache']->save('your-key', 'your-data'); $data = $app['cache']->fetch('your-key'); echo $data; // your-data
License
MIT License