-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Review Required] Drop cache adapter support with Laravel 5.8+ #73
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me after the small changes!
Thanks :)
src/SwapServiceProvider.php
Outdated
return new SimpleCacheBridge(new IlluminateCachePool($store)); | ||
return $store instanceof \Psr\SimpleCache\CacheInterface | ||
? $store | ||
: new SimpleCacheBridge(new IlluminateCachePool($store->getStore())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you throw an exception if the class does not exist with a message suggesting to install the php-cache package ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added changes in order to throw an exception if PSR-6 adapter or PSR-16 bridge is missing.
``` | ||
|
||
These dependencies are not required with Laravel 5.8 or greater. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add the same to /doc/readme.md
?
Thanks a lot @kslimani |
Can we get a new version tagged? @florianv |
@josiasmontag Done! |
Disclaimer : It is a proposition only, i am not sure if it is the way to go.
Since Laravel 5.8, cache repository instance implements
\Psr\SimpleCache\CacheInterface
, so (if i am not wrong) does not require simple cache bridge anymore.This PR is an attempt to drop these dependencies (by default) and also add support for Laravel 6.
For Laravel 5.7 or lesser it should simply require to add
cache/illuminate-adapter
andcache/simple-cache-bridge
dependencies using composer. (i edited readme file to reflect theses changes).If you disagree, simply close this PR. If it require some changes, just let me know !