sergiors / doctrine-cache-service-provider
Doctrine Cache for Pimple
Installs: 45 984
Dependents: 5
Suggesters: 1
Security: 0
Stars: 6
Watchers: 6
Forks: 3
Open Issues: 0
Requires
- php: ^7.1
- doctrine/cache: ~1.4
- pimple/pimple: ^3.0
Requires (Dev)
- pdepend/pdepend: ~2.0
- phing/phing: ~2.10
- phploc/phploc: ^4
- phpmd/phpmd: ~2.2
- phpunit/phpunit: ^6.0
- sebastian/phpcpd: ~2.0
- squizlabs/php_codesniffer: ~2.1
README
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