bamarni / symfony-http-cache-extension
Installs: 4 708
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 3
Forks: 3
Open Issues: 1
Requires
- php: >=5.3.2
- doctrine/cache: 1.*
- symfony/http-kernel: 2.*
Requires (Dev)
Suggests
- symfony/framework-bundle: For integration with the framework
This package is auto-updated.
Last update: 2024-11-05 22:51:34 UTC
README
EXPERIMENTAL (WIP)
Some stores + custom http_cache
Http Cache Doctrine Store
Store implementation for Symfony HttpCache relying on Doctrine Cache.
Instructions
Install the package
Add the following dependency to your composer.json file:
{ "require": { "_some_packages": "...", "bamarni/symfony-http-cache-extension": "*" } }
Edit your project's HttpCache
Configure a Doctrine Cache driver and pass it to a DoctrineStore :
<?php // app/AppCache.php use Bamarni\HttpCache\HttpCache; use Bamarni\HttpCache\Store\DoctrineStore; //use Doctrine\Common\Cache\ApcCache; use Doctrine\Common\Cache\MemcacheCache; class AppCache extends HttpCache { public function createStore() { // Memcache $memcache = new \Memcache; $memcache->connect('localhost', 11211); $driver = new MemcacheCache; $driver->setMemcache($memcache); // or APC //$driver = new ApcCache; return new DoctrineStore($driver); } }