chh / cache-service-provider Goto Github PK
View Code? Open in Web Editor NEWA Cache Service Provider for Silex, using the doctrine/cache package
License: MIT License
A Cache Service Provider for Silex, using the doctrine/cache package
License: MIT License
Currently all individual caches are services in a separate Pimple container, which is set as the caches
service of the application.
This makes it easy to pass the complete collection of defined caches to something, but at the same time makes it a bit more work to define or extend just a single cache at a time, because you have to extend the caches
service first.
The question is: Is anyone using the caches
service and would it be acceptable to remove this service and to setup caches as services of the application's container (e.g. cache.default
)?
This change would also bring it more in line with other service providers, which create services on the application's container, e.g. Doctrine.
Currently the cache.factory
and the cache.namespace
services are protected closures, which return closures, which then return a cache instance. Change these services to be just protected closures, which return a cache instance to reduce complexity and bring it in line with conventions.
Before:
$app['caches'] = $app->extend('caches', function ($caches) use ($app) {
$caches['foo'] = $app['cache.namespace']('foobar');
return $caches;
});
After:
$app['caches'] = $app->extend('caches', function ($caches) use ($app) {
$caches['foo'] = function () use ($app) {
return $app['cache.namespace']('foobar');
};
return $caches;
});
Tasks:
CacheNamespace
and the CacheServiceProvider
class are in the same namespace (BC break)composer.json
Silex 1.1 stable released http://silex.sensiolabs.org/doc/changelog.html
Current requirement in this provider is 1.0.*@dev
so doesn't let to update to it.
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.