egils / cache Goto Github PK
View Code? Open in Web Editor NEWPSR-6 compliant cache component
License: MIT License
PSR-6 compliant cache component
License: MIT License
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.
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);
}
There are different thinks I noticed while working with this project:
[]
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.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 \
.As PSR-6 specification states deferred but not-yet-persisted objects should be retrievable. As @scento noticed, this is not yet implemented.
Requests for a cache item that has been deferred MUST return the deferred but not-yet-persisted item.
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
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.