Git Product home page Git Product logo

cache's People

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

shieldo

cache's Issues

This package should be marked as deprecated on packagist

This package is providing its own implementation of the PSR Cache interfaces, but with a different interface than the official ones.
Please mark it as unmaintained on Packagist so that people see this when looking for implementations

[DoctrineCacheAdapter] Persist deferred objects on-the-fly

The following condition is not implemented since deferred objects are not saved without calling commit() and are lost.

A Pool MUST ensure that any deferred cache items are eventually persisted and data is not lost, and MAY persist them before a Calling Library requests that they be persisted.

Specification mentions couple of possible solutions to this problem. Which ones to implement is yet to be decided.

An Implementing Library MAY use whatever logic is appropriate to determine when to persist deferred items, such as an object destructor, persisting all on save(), a timeout or max-items check or any other appropriate logic.

Code style

There are different thinks I noticed while working with this project:

  1. Nearly all code in this project uses the short array syntax [] to create new arrays. This syntax was introduced in PHP 5.4 - since many projects, which might depend on this project, support at least PHP 5.3, it might be useful to refactor the project regarding the full syntax.
  2. use-clauses are always relative paths. This can lead to problems, when PHP is searching e.g. DateTime in \Egils\Component\Cache\Adapter and not in \.

Doctrine Adapter's "getItem()" behaves incorrect

The doctrine adapter does not return an Instance of Psr\Cache\CacheItemInterface, when calling getItem() with an not-existing key, but instead false. The specifications especially refer to this way to request an instance.

A better solution would be an implementation for getItem() like this:

if ($this->provider->contains($key) === true) {
      $item = $this->provider->fetch($key);
      $item->setHit(true);
      return $item;
} else {
      return new CacheItem($key);
}

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.