Skip to content
Cache Service Provider based on Doctrine Cache for Silex
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
tests
travis
.gitignore
.scrutinizer.yml
.travis.sh
.travis.yml
README.md
composer.json
composer.lock
phpunit.xml.dist

README.md

Cache Service Provider

Build Status Scrutinizer Code Quality Code Coverage HHVM Latest Stable Version Total Downloads License

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

You can’t perform that action at this time.