Closed sunra closed 7 years ago
Hey @sunra. There is none at the moment, and I didn't have any plans to create one (yet).
You wouldn't happen to be interested in building one? I'd be happy to help out!
a symfony bundle would be great
no need imho
yml:
parameters:
cache_sqlite_db: 'sqlite:%kernel.root_dir%/../var/cache/%kernel.environment%/cache.db'
services:
cache.db:
class: PDO
arguments: ["%cache_sqlite_db%"]
cache.adapter:
class: MatthiasMullie\Scrapbook\Adapters\SQLite
arguments: ["@cache.db"]
cache.pool:
class: MatthiasMullie\Scrapbook\Psr6\Pool
arguments: ["@cache.adapter"]
cache.taggablepool:
class: MatthiasMullie\Scrapbook\Psr6\Taggable\Pool
arguments: ["@cache.pool"]
usage in controller:
$pool = $this->get('cache.taggablepool');
$item = $pool->getItem('your_key');
if (!is_null($item->get())) {
$data = $item->get();
}
else {
$data = // do something to cache
$item->set($data);
$item->expiresAfter(600); //cache for 10 minutes
$pool->save($item);
}
I agree with @radoslavius that this is not really needed. All features are easy to "enable" just by wrapping them inside one another, from the YML file. Here's another example: https://github.com/forkcms/forkcms/blob/master/app/config/config.yml#L89
If anyone feels a Symfony bundle is useful and is willing to create one, I wouldn't mind helping out. But for now, I'm closing this :)
in code? in plans?