sergiors/doctrine-cache-service-provider

Doctrine Cache for Pimple

3.0.0 2017-12-11 00:40 UTC

This package is not auto-updated.

Last update: 2024-11-22 14:23:00 UTC


README

Build Status

To see the complete documentation, check out Doctrine Cache

Install

composer require sergiors/doctrine-cache-service-provider

How to use

use Sergiors\Pimple\Provider\DoctrineCacheServiceProvider;

$app->register(new DoctrineCacheServiceProvider(), [
    'cache.options' => [
        'driver' => 'redis',
        'namespace' => 'myapp',
        'host' => '{your_host}',
        'port' => '{your_portt}',
        // 'password' => ''
    ]
]);

// $app['cache']->save('cache_id', 'my_data');
// $app['cache']->fetch('cache_id');

Multiple instances

Something like this:

use Sergiors\Pimple\Provider\DoctrineCacheServiceProvider;

$app->register(new DoctrineCacheServiceProvider(), [
    'caches.options' = [
        'conn1' => 'xcache',
        'conn2' => [
            'driver' => 'redis'
        ],
        'conn3' => [
            'driver' => 'array',
            'namespace' => 'test'
        ]
    ]
]);

// $app['caches']['conn1'];
// $app['caches']['conn2'];
// $app['caches']['conn3'];

Be Happy!

License

MIT