moust / silex-cache-service-provider Goto Github PK
View Code? Open in Web Editor NEWA Cache Service Provider for Silex
License: MIT License
A Cache Service Provider for Silex
License: MIT License
In FileCache class, the exists function always returns false.
The fetch function, expects the cache key, but in the exists function, the filename is passed to the fetch function.
So
public function exists($key)
{
return !!$this->fetch($this->getFileName($key));
}
Should be changed to:
public function exists($key)
{
return !!$this->fetch($key);
}
Hi,
I followed the doc, so here is my bootstrap :
$app['cache.options'] = array(
'driver' => 'redis',
'redis' => function() {
$redis = new \Redis();
$redis->connect('myserver', 6379);
return $redis;
}
);
Doesn't work...
And when I launch my debugger, at this line in RedisCache.php
if (!isset($options['redis']) || !$options['redis'] instanceof Redis) {
//default connection
}
The debugger goes inside the loop ... And it shouldn't go inside
Because the closure never called.
I think the code should be something like :
if (!isset($options['redis']) || !is_callable($options['redis']) || !$options['redis']() instanceof Redis) {
//default connection
}
Same code for the other providers but i didn't try them.
What do you think ?
Supports silex ~2.0
Earlier everything worked, but now 1.0 also want pimple 3.0, while silex 1.3 use pimple 2.0.
How to fix this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.