Comments (11)
Same problem here.
This is caused by these 4 occurrences of cache_expiration_time
https://github.com/simplepie/simplepie/blob/master/src/SimplePie.php#L1676
https://github.com/simplepie/simplepie/blob/master/src/SimplePie.php#L1769
https://github.com/simplepie/simplepie/blob/master/src/SimplePie.php#L1920
cache_expiration_time
=> should be => __cache_expiration_time
Or at least the array index should be consistent everywhere...
from simplepie.
Then, a simple example on how to then set the cache type (i.e. file), location and duration would be nice.
The current documentation only mentions a deprecated example and does not say anything about PSR-16 ...
from simplepie.
At least it's clear that the PSR-16 changes in #752 broke the legacy cache.
I think reverting 3ba7c91 will fix this bug
Would you consider this, please?
from simplepie.
Looks good, please go ahead
from simplepie.
The default file cache is deprecated an will be removed in the next major release. Instead you should use a PSR-16 cache implementation like Symfony Cache or every other implementation.
$simplepie = new \SimplePie\SimplePie();
$simplepie->set_cache(
new \Symfony\Component\Cache\Psr16Cache(
new \Symfony\Component\Cache\Adapter\FilesystemAdapter()
),
);
from simplepie.
Then, a simple example on how to then set the cache type (i.e. file), location and duration would be nice. The current documentation only mentions a deprecated example and does not say anything about PSR-16 ...
The code example is from #777. Setting cache type and location is part of the PSR-16 implementation. The cache duration is still configured using $simplepie->set_cache_duration($seconds);
.
from simplepie.
I still don't see an example that one can easily copy/past and just fill in 2 or 3 parameters.
Not everyone can read the whole PSR-16 spec to write a few lines of code...
from simplepie.
I still don't see an example that one can easily copy/past and just fill in 2 or 3 parameters.
Please take a look again at my comment above. It already shows you a working example using Symfony Cache using the FilesystemAdapter. But you are free to choose another adapter or even every other implementation.
Not everyone can read the whole PSR-16 spec to write a few lines of code...
You don't have to read the PSR-16 spec. You have to look at the more than 100 implementations (and the PSR-16 spec allows you to try and use them all). Choose the one that works best for you. No one knows your project and use case better than you do.
from simplepie.
The example above does not show how to define the (custom) cache file location.
Which PSR-16 is really not so important, so any will do, that is why people needs a simple example
from simplepie.
The example above does not show how to define the (custom) cache file location. Which PSR-16 is really not so important, so any will do, that is why people needs a simple example
The file location in the FilesytemAdapter is not required, it uses sys_get_temp_dir()
by default. If needed please read the docs for more customization.
I would like to avoid more complex examples for a specific library. Mentioning the Symfony cache implementation alone is already very opinionated. Using the filesystem adapter as cache type is also opinionated. If you would like to have a more customized example for this library in the docs you are welcome to open a PR.
from simplepie.
I've found the reason for this issue and opened #846.
@bart-v Could you please confirm that this PR will fix your issue?
from simplepie.
Related Issues (20)
- Necessary website changes HOT 1
- [BUG] Uncaught TypeError: array_slice(): Argument #3 ($length) must be of type ?int HOT 1
- Use SPDX comments HOT 1
- [ENH] Revise the phpdoc tags `@package` and `@subpackage`
- Removing the compiled single-file build HOT 7
- Demo folder not in zip file HOT 2
- php 8.2 [BUG] HOT 5
- [BUG] must be of type string, bool given in /framework/simplepie/src/Locator.php:330 HOT 2
- [BUG] PHP Fatal error: Uncaught TypeError: strspn(): Argument #1 ($string) must be of type string, null given in /framework/simplepie/src/Content/Type/Sniffer.php:153 HOT 3
- [BUG] HOT 1
- [BUG] PHP Fatal error: Uncaught TypeError in Sanitize::replace_urls due to a link without host HOT 1
- [ENH] Allow custom headers to configure for feed HOT 2
- URL in the comments of Sanitize.php is dead
- Cannot serve directory issues HOT 6
- HTML between <script> and </script> should be ignored HOT 3
- Downloads and system requirements pages on the website are outdated as of 2023 HOT 1
- Boolean passed to trim() throws fatal error in PHP8.2 and Simplepie 1.8 HOT 4
- Typos HOT 3
- Release 1.9.0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simplepie.