Open GoogleCodeExporter opened 9 years ago
Or maybe:
$content = (function_exists('curl_init')) ? http::fetch_content($url) :
file_get_contents($url);
Original comment by michiele...@gmail.com
on 14 Sep 2009 at 2:18
It seems unlikely that curl would be enabled on systems where allow_url_fopen is
disabled (though I don't doubt the possibility). Can you think of any reason
this
would be the case? The user could also enable url_fopen for the currently
running
script using ini_set().
Perhaps we should consider making url_fopen be a requirement of accessing remote
objects and document as such.
I'm not totally against curl support, I just want to make sure we do it for the
right
reasons.
Original comment by eclecticgeek
on 14 Sep 2009 at 5:52
Well, we host a hosting server. We and also others disable by default
allow_url_fopen, because it could be used by hacking attack, which makes your
server
rather vulnerable. So for security sakes we disable it by default. But I know of
other hosting services, which won't even enable it, even if you ask them. So
that is why.
Also CURL can be seen as browser, by sending useragent headers as well as
Forwarded-For headers, so websites which use browser detection, or website
which do
have a rather strong client/header policy (like mod_security) could be used as
well.
Indeed I go with the suggestion you'd rely on url_fopen, if you see my second
reason
for using curl as "browser" as not worth. Because url_fopen is more precise than
allow_url_fopen.
Curl is by the way on more and more servers installed. Because everyone is
going to
PHP5 and webservices are a major issue in the common days. Most webservice
libraries
use Curl nowadays.
Original comment by michiele...@gmail.com
on 14 Sep 2009 at 6:12
Another advantage of using CURL is using cookies to access secure images on the
server on which the PDF library is located.
See http://svetlozar.net/page/free-code.html for reference code.
Original comment by michiele...@gmail.com
on 5 Oct 2009 at 12:48
Original comment by eclecticgeek
on 24 May 2013 at 3:00
Original issue reported on code.google.com by
michiele...@gmail.com
on 14 Sep 2009 at 2:11Attachments: