Ticket #477 (closed defect: wontfix)
Support curl as an alternative to fopen
| Reported by: | tboutell | Owned by: | tboutell |
|---|---|---|---|
| Priority: | major | Milestone: | 1.4.2 |
| Component: | apostrophePlugin | Version: | 1.4 |
| Keywords: | compatibility | Cc: | jake, agilbert, geoffd |
| Symfony version: | 1.4 |
Description (last modified by tboutell) (diff)
Yes, file_get_contents is a neat and easy way to pull stuff from web APIs, but lots of hosting environments disable http access for PHP file streams (god knows why). We don't actually have all that many places where we depend on this feature and in pretty much all of them we could use a simple wrapper of our own instead, in the same way that aImageConverter supports both netpbm and gd. This is not monstrously complicated in the way that supporting multiple databases can be.
curl seems to be more widely enabled, so that would be the alternative to support.
simplexml_load_file turns out to be the culprit most of the time (it relies on stream wrappers too), notably for all of our youtube support. Wrap that with a version that plods through getting the stuff from curl if need be and then calls simplexml_load_string.

