php-http / message-factory

Abandoned: Httplug Factory interfaces for PSR-7 HTTP Message
http://php-http.org
MIT License
1.38k stars 10 forks source link

Create implementation independent Multipart Streams #29

Closed digitalkaoz closed 8 years ago

digitalkaoz commented 8 years ago

currently if i want to create a MultiPart Form Request (Form Fields + Files) i cant do this without relying on a concrete Implementation (like https://github.com/guzzle/psr7/blob/master/src/MultipartStream.php)

either the current StreamFactory can handle mixed Stream Inputs, or we need a whole new Factory

dbu commented 8 years ago

i think we should do a separate interface for that. otherwise we a) create a BC break as existing factories would suddenly need to implement a new interface and b) not all implementations necessarily can provide a multipart stream. in factory implementations, the same factory can (and should) implement both interfaces if possible. or maybe, the MultipartStreamFactoryInterface could even extend the StreamFactoryInterface, i can't imagine a case where you only can provide multipart but not simple streams. that will make injection simpler if you need both types of streams in an application.

digitalkaoz commented 8 years ago

i think extending the current StreamFactory makes sense

dbu commented 8 years ago

want to do a pull request for this? once merged, we can start to implement that on the factories for guzzle and so on... it can go into the next minor version, its a new feature without BC break.

digitalkaoz commented 8 years ago

i can try, but dont know if i find some time this weekend...the weather is quite nice this weekend and the kids needs to go outside ;)

digitalkaoz commented 8 years ago

@dbu done #30 ;)

Nyholm commented 8 years ago

Closed, see comment: https://github.com/php-http/message-factory/pull/30#issuecomment-233652431