Git Product home page Git Product logo

Comments (11)

bart-v avatar bart-v commented on June 15, 2024 1

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.

bart-v avatar bart-v commented on June 15, 2024 1

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.

bart-v avatar bart-v commented on June 15, 2024 1

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.

bart-v avatar bart-v commented on June 15, 2024 1

Looks good, please go ahead

from simplepie.

Art4 avatar Art4 commented on June 15, 2024

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.

Art4 avatar Art4 commented on June 15, 2024

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.

bart-v avatar bart-v commented on June 15, 2024

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.

Art4 avatar Art4 commented on June 15, 2024

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.

bart-v avatar bart-v commented on June 15, 2024

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.

Art4 avatar Art4 commented on June 15, 2024

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.

Art4 avatar Art4 commented on June 15, 2024

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)

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.