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

Leverage PSR-17 to use generic PSR-7 factories #693

Closed
Jean85 opened this issue Nov 14, 2018 · 4 comments
Closed

Leverage PSR-17 to use generic PSR-7 factories #693

Jean85 opened this issue Nov 14, 2018 · 4 comments
Milestone

Comments

@Jean85
Copy link
Contributor

Jean85 commented Nov 14, 2018

As reported in https://github.com/getsentry/sentry-php/pull/682/files#r231547783, we can leverage PSR-17 to not rely on Diactoros directly to obtain the PSR-7 request object during event generation.

@Jean85 Jean85 added this to the Release 2.0 milestone Nov 14, 2018
@Jean85
Copy link
Contributor Author

Jean85 commented Nov 16, 2018

I've tried multimple times, but I can't require the virtual package...

$ composer require psr/http-factory-implementation:^1.0                            
                                                                                                                                                                                                       
  [InvalidArgumentException]                                                                                                                                                                               
  Could not find a matching version of package psr/http-factory-implementation. Check the package spelling, your version constraint and that the package is available in a stability which matches your minimum-stability (stable).

@ste93cry you where able to do it with PSR-7, how did you do it?

@Jean85
Copy link
Contributor Author

Jean85 commented Nov 16, 2018

I talked to @ste93cry and checked on HTTPlug progress. It seems that PSR-17 is too young for now, and they don't support it for now: php-http/message-factory#37

We should leave this issue open, but remove the milestone since it's not feasible now, in the short term.

@Jean85 Jean85 removed this from the Release 2.0 milestone Nov 16, 2018
@Jean85 Jean85 added this to the Release 2.1 milestone Nov 26, 2018
@ste93cry ste93cry removed this from the 2.1 milestone May 14, 2019
@stayallive stayallive changed the title [2.0] Leverage PSR-17 to use generic PSR-7 factories Leverage PSR-17 to use generic PSR-7 factories Sep 19, 2019
@BusterNeece
Copy link

Hello all! The PSR-17 and PSR-18 specifications for factories and HTTP clients respectively have seen improved adoption since this issue was created, with Guzzle now directly implementing PSR-18 and the http-interop/http-factory-x libraries implementing PSR-17.

It would be really nice to see a version of this library that's decoupled from httplug and supports using any implementation of the PSR spec instead, so we can bring our own versions of each if our application already uses them.

@ste93cry
Copy link
Contributor

ste93cry commented Jul 4, 2020

It would be really nice to see a version of this library that's decoupled from httplug and supports using any implementation of the PSR spec instead, so we can bring our own versions of each if our application already uses them.

Even though we didn't talk about this yet, I strongly think that we are gonna do this in 3.0 which should be released by the end of the year. You can track the progress of that version on the 3.x branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants