Move the PHP HTTP Extension priority down the list for WP_HTTP
|Reported by:||dd32||Owned by:|
|Component:||HTTP API||Keywords:||dev-feedback 2nd-opinion|
Currently the PHP HTTP Extension is receiving the top priority slot for which transport HTTP requests go out through.
However, the extension is also the least tested, and also now uses the most memory when using Stream-to-file functionality for downloads.
In addition to this, in most cases the HTTP Extension appears to be a simple cURL wrapper, falling back to fopen() & friends for certain functionality. This leads to cURL being available in most cases, and given we can control cURL's options easier than we can the HTTP extension, it makes sense to bump that up to position 1.
In addition to this, the extension's ::test() method does not seem to cover all bases, leading back to the least-tested. For example, it requires the .ini setting 'allow_url_fopen' to be enabled for certain functionalities (HEAD Requests & Certain redirection cases) - For example, it fails with this on 4 of the 14 unit tests:
file_get_contents(): http:// wrapper is disabled in the server configuration by allow_url_fopen=0
- Least Tested (historically at least, It may become more tested as PHP5 is more common)
- Requires more memory for Stream-to-file (Can use an extra ~9MB for downloading a 3MB file compared to using Curl, Streams, or fsockopen)
- Can't make non-blocking requests (In this case, it's already the last transport that is tried)