NYCPHP Meetup

NYPHP.org

[nycphp-talk] PHP error handling with simplexml_load_file questions.

Chris Snyder chsnyder at gmail.com
Tue Dec 29 11:13:37 EST 2009


On Tue, Dec 29, 2009 at 10:52 AM, John Campbell <jcampbell1 at gmail.com> wrote:
> It doesn't work on some installs, may break with ssl, doesn't support
> cookies reliably, can't handle http errors, may or may not follow
> redirects, etc. simple_xml_load_file() on a
> remote resource is great for article writers because they don't have
> to have a bunch of boilerplate curl code in the article, but it is a
> mistake for a real application.

Yeah, second that. I'm not a curl believer so I use PHP streams, but
same difference.

The reason I use sockets / streams is because you have very fine
control over both connection and transmission timeouts.
file_get_contents() and friends are perfectly happy to wait around for
30 seconds when connecting to a slow server.



More information about the talk mailing list