Skip to content
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

Add support for PSR-18 HTTP clients #826

Draft
wants to merge 15 commits into
base: master
Choose a base branch
from

Commits on Nov 6, 2023

  1. Revert "Merge pull request simplepie#777 from Art4/add-psr18-http-cli…

    …ent-support"
    
    There are correctness issues as well as disorganized commit history.
    The fixed changes are re-applied in the commits that follow.
    jtojnar committed Nov 6, 2023
    Configuration menu
    Copy the full SHA
    9400f7d View commit details
    Browse the repository at this point in the history
  2. Create Psr7Response and Psr18Client

    Art4 authored and jtojnar committed Nov 6, 2023
    Configuration menu
    Copy the full SHA
    802d33a View commit details
    Browse the repository at this point in the history
  3. Psr18Client follows redirects

    Art4 authored and jtojnar committed Nov 6, 2023
    Configuration menu
    Copy the full SHA
    58d812a View commit details
    Browse the repository at this point in the history
  4. Add tests with local files for FileClient

    Art4 authored and jtojnar committed Nov 6, 2023
    Configuration menu
    Copy the full SHA
    1092570 View commit details
    Browse the repository at this point in the history
  5. Add tests with local files for Psr18Client

    Art4 authored and jtojnar committed Nov 6, 2023
    Configuration menu
    Copy the full SHA
    b0427c9 View commit details
    Browse the repository at this point in the history
  6. SimplePieTest: materialize provider

    Providers are meant for data parametrization.
    This one basically created a completely different test situation
    and what we are going to test next will be even more wild.
    Let’s dissolve the provider into individual test cases.
    Art4 authored and jtojnar committed Nov 6, 2023
    Configuration menu
    Copy the full SHA
    44cdd6b View commit details
    Browse the repository at this point in the history
  7. Set SimplePie->$file to private

    We are going to allow using HTTP Clients that will set this to a different
    `Response` subclasses than just `File`.
    
    It was already marked private with PHPDoc, let’s enforce it.
    Hopefully, this will produce a more scrutable error message
    in case someone wants to access `File` properties on this.
    Art4 authored and jtojnar committed Nov 6, 2023
    Configuration menu
    Copy the full SHA
    7d64ada View commit details
    Browse the repository at this point in the history
  8. Add SimplePie::set_http_client(), add tests

    This will allow using PSR-18 HTTP Clients.
    
    Since those return a different `Response` subclass than `File`,
    we need to convert `Response` to `File` to pass it to `Locator`, `Sniffer` & co.
    Art4 authored and jtojnar committed Nov 6, 2023
    Configuration menu
    Copy the full SHA
    eddf1a1 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    55bb279 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    67528cc View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    089fe8f View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    1f2881a View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    35788eb View commit details
    Browse the repository at this point in the history
  14. Add Sanitize::set_http_client()

    Allows passing PSR implementations to Sanitize instead of internal HTTP Client.
    
    TODO: Possibly make the set_http_client method internal again.
    Art4 authored and jtojnar committed Nov 6, 2023
    Configuration menu
    Copy the full SHA
    6a188f8 View commit details
    Browse the repository at this point in the history
  15. Add Locator::set_http_client()

    Allows passing PSR implementations to Locator instead of internal HTTP Client.
    
    TODO: Possibly make the set_http_client method internal again.
    Art4 authored and jtojnar committed Nov 6, 2023
    Configuration menu
    Copy the full SHA
    0427439 View commit details
    Browse the repository at this point in the history