Comments (7)
I've actually been thinking about this for some time; thanks for the nudge! I'll try and schedule this for development soon.
from laminas-diactoros.
@weierophinney I think we will want to handle this for 3.0.0
from laminas-diactoros.
actually... I'm removing from the 3.0 milestone, as it's a bigger issue.
I think the plan should be:
- Finalize laminas-diactoros-serializer (and instead name it laminas-psr7-serializer)
- Once that's released, in a minor version, we update the implementations here to proxy to those classes
- Next major, we remove the implementations
The problem I have with doing this for 3.0 is because there's likely a lot of work for this, and I'd rather not delay pushing out our PSR-7 v2 support for something that's (a) optional, (b) has already lingered years, and (c) is not clearly defined. Because of the history limits with free versions of Slack, I don't have the full discussion notes from when we discussed this in July, 2020. All I have are what are in the minutes from the TSC meeting that month, and... frankly it's vague (e.g. "like to see interfaces created for serialization", "might be better suited as hydrators/extractors") or clearly a larger effort (e.g. "can they create HTTP/2 messages as well as HTTP/1.1").
I'll still start working on it, but I'm going to push to 3.1.
from laminas-diactoros.
I have this extracted here: https://github.com/weierophinney/laminas-diactoros-serializer
I'll be asking the @laminas/technical-steering-committee if we can bring this under the Laminas umbrella during the next TSC meeting (first Monday of July).
from laminas-diactoros.
Awesome, thanks so much!
This is a huge help; I wrote my own serializers using identical serialization so this will just drop right in!
from laminas-diactoros.
@matt-allan During the TSC meeting this week, some suggestions for improving the architecture were provided. I'm going to see which suggestions I can incorporate, and then will bring this back to the TSC. You can, of course, continue to use the package I've created in the meantime; just pin it to a sha1 when you do.
from laminas-diactoros.
I've prepared version 0.2.0 of laminas-psr7-serializer: https://github.com/weierophinney/laminas-psr7-serializer/releases/tag/0.2.0
I'll ask at the next TSC meeting if we can bring that into Laminas proper, and then we can work on updating the classes in Diactoros to proxy to that instead. When we do, we'll emit a deprecation notice, so folks know to update their code to the new library.
One thing to note: laminas-psr7-serializer does not define interfaces. It would be trivial to extract these, but essentially it becomes an interface per serialization type. The only place I see that being worthwhile is with array serialization, as that's the one place you could end up with different implementations. However, even there, it becomes problematic, because you wouldn't be able to rely on deserializing back to an object if the array structures vary, which makes me lean towards not providing interfaces.
from laminas-diactoros.
Related Issues (20)
- `FilterUsingXForwardedHeaders` should correctly deal with `<host>:<port>` pair in `X-FORWARDED-HOST` header HOT 9
- [RFC]: Allow better constraint handling for PHP HOT 2
- Could ServerRequestFactory::marshallUriFromSapi() be made public? HOT 4
- Update to PSR-7 1.1/2.0 HOT 2
- Remove image stream compatibility from `Stream`
- CVE-2023-29530: Fix For PHP 7.4 HOT 16
- CLI command to register diactoros as pinned for `php-http/discovery`
- Drop deprecated function marshalUriFromSapi
- PhpInputStream::getContent() inconsistency HOT 9
- RFC: Read php input stream content into php temp stream to allow all stream features in PhpInputStream HOT 1
- Numeric header names handling in PSR-7 message objects
- V3 getBody()->getContents() no longer returns full stream on second call HOT 3
- `composer.json` provides non-existing versions of `psr/http-factory`
- security vonerability HOT 1
- Plus signs in cookie data get converted to space.
- marshal_headers_from_sapi.php line 29 HOT 2
- `Uri::__toString()` can yield malformed URIs HOT 2
- 2.x series does not support PHP 8.3 HOT 20
- [RFC]: Remove `scheme` filtering HOT 3
- Malformed request causes 500 response HOT 7
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 laminas-diactoros.