rmccue/Requests — pull request #101 by ozh (2014-02-05 13:14:50+00:00)
Title: Contextually check for a valid transport

Currently a valid transport is selected with simple tests (functions exist).

This can lead to error: using streams but without having openssl, or using curl with an old build, a transport that cannot perform HTTPS requests will still be selected.

My PR checks for a valid transport in a given context: do we need to make SSL requests or not?

The main change is that instead of `get_transport()` we now have `get_transport(array $capabilities)`. Currently only `ssl` is checked but we can imagine this being expanded if needed in the future.

A new option is introduced and documented, `need_ssl`, but this should be mostly left untouched as its default value will be set to what is needed (`true` or `false` depending on whether `$url` starts with `https` or not)

Of course a check for a valid transport is performed only once for the same capability

I think everything is pretty much self explanatory, but feel free to ask for details if needed