Processing HTTP requests and responses is a big pain in the backside. It's got all sort of picky edge cases and if you screw it up, you're likely to introduce vulnerabilities.
Symfony has already figured out all of this stuff and can do it way better than we can. Doing this ourselves provides zero value and is all downside.
If practical, we should leverage symfony/http-foundation in CMS5. If there's not enough time, let's look at it for CMS6.
Possible approaches
- Approach A - Nuke HTTPRequest, HTTPResponse and related classes altogether. Use the equivalent Symfony classes directly.
- Approach B - Refactor HTTPRequest, HTTPResponse and related classes to extend the equivalent Symfony classes. Preserve any Silverstripe specific logic.
- Approach B1 - Delete all existing method that have Symfony equivalents.
- Approach B2 - Convert all existing method that have Symfony equivalents to be aliases (try to nudge people to use the Symfony method instead).
- Approach B3 - Update all method parameters that expect a HTTPResponse or HTTPRequest to expect the Symfony class instead.
- Approach C - Wrap around HTTPRequest and HTTPResponse around a private instance of their equivalent Symfony object.
Side Quest
Somewhat related, once upon a time we thought about implementing PSR7. A lot of the concerns there are still relevant today. The conclusion was use a "bridging module" which we never got around to creating ... Robbie had a PoC.
If we go with Symfony, people who need PSR7 can potentially piggyback of the Symfony bridging approach. We might be foreclosing direct support for for PSR7 however.
Equivalence
@silverstripe/core-team
Processing HTTP requests and responses is a big pain in the backside. It's got all sort of picky edge cases and if you screw it up, you're likely to introduce vulnerabilities.
Symfony has already figured out all of this stuff and can do it way better than we can. Doing this ourselves provides zero value and is all downside.
If practical, we should leverage symfony/http-foundation in CMS5. If there's not enough time, let's look at it for CMS6.
Possible approaches
Side Quest
Somewhat related, once upon a time we thought about implementing PSR7. A lot of the concerns there are still relevant today. The conclusion was use a "bridging module" which we never got around to creating ... Robbie had a PoC.
If we go with Symfony, people who need PSR7 can potentially piggyback of the Symfony bridging approach. We might be foreclosing direct support for for PSR7 however.
Equivalence
@silverstripe/core-team