Giter Site home page Giter Site logo

cache-service-provider's People

Contributors

bradley-holt avatar chh avatar rarst avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cache-service-provider's Issues

Remove caches service?

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.

Move factories to be plain protected closures which return a cache

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;
});

Change namespace to be PSR-4 compliant

Tasks:

  • Change the namespace to something where the CacheNamespace and the CacheServiceProvider class are in the same namespace (BC break)
  • Use PSR-4 autoloader in composer.json

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.