-
Notifications
You must be signed in to change notification settings - Fork 385
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
Use Psr16 cache as Default, deprecate \SimplePie\Cache\Base implementations #752
Conversation
because we allow to inject the PSR-16 cache and also a cache_name_function, the user should be notified about bad cache config
Might be nice to rebase this onto master so it can be reviewed commit by commit more easily. |
|
||
- The method `SimplePie\SimplePie::set_cache_location()` is deprecated, use `SimplePie\SimplePie::set_cache()` instead | ||
- The method `SimplePie\SimplePie::force_cache_fallback()` is deprecated, expired cache will not be used anymore | ||
- The class `SimplePie\Cache` is deprecated, use implementation of `SimplePie\SimplePie::set_cache()` instead |
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.
Should this say Psr\SimpleCache\CacheInterface
?
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 thought while using SimplePie\Cache
will not only allow you to get a cache implementation but also to register a cache implementation the reference to SimplePie\SimplePie::set_cache()
makes that clearer.
@@ -0,0 +1,157 @@ | |||
<?php | |||
/** | |||
* SimplePie |
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.
A bit of topic but I wonder if it might make sense to replace blurbs with SPDX identifiers, see
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.
Never heard of reuse.software before, but it sounds good.
return $default; | ||
} | ||
|
||
// ingore data if internal cache expiration time is not set |
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.
typo
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.
fixed in #761
use InvalidArgumentException; | ||
|
||
/** | ||
* Simplified PSR-16 Cache client for caching data arrays |
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.
Simplifies how?
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.
It uses only a subset of PSR-16 (only get()
, set()
and delete()
, but not has()
, getMultiple()
, setMultiple()
or deleteMultiple()
),
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.
Might be nice to mention it explicitly in the comment.
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.
fixed in #761
see comment from @jtojnar in simplepie#752
see comment from @jtojnar in simplepie#752
* bump version to 1.8.0 * Update CHANGELOG.md * Fix version tags in deprecated messages * fix version in old deprecation messages * Fix typo see comment from @jtojnar in #752 * Add comment for DataCache interface see comment from @jtojnar in #752 * Update CHANGELOG.md for #760, #764 and #765 * Update CHANGELOG.md for #762, #767 and #763 * Update CHANGELOG.md for #768 and #770 * Update release date * Update CHANGELOG.md for #769 and #771 * Update CHANGELOG.md for #766
Hi all 👋
This is a follow-up PR of #742. I propose this PR for SimplePie 1.8, see #731.
In this PR I've changed the internal cache usage to a more PSR-16 style, see the new interface
SimplePie\Cache\DataCache
. This interface could be removed in SimplePie 2.0 and the provided PSR-16 implementation can be used directly. This will bring us more advantages like\Psr\SimpleCache\CacheInterface::setMultiple()
.For BC reasons I've created a simple adapter class
SimplePie\Cache\BaseDataCache
for the currentSimplePie\Cache\Base
implementations. This allows us to use the PSR-16 implementation from #742, but also support the old cache implementations. Furthermore I deprecated all cache implementations in favor of the PSR-16 cache.This will
file_put_contents()
is not atomic and can cause race in file caching #740,