Re: simpleXML - simplexml_load_file() timeout?
| From: | Robert Cummings | Date: | Tue, 11 Apr 2006 01:08:40 +0000 |
| Subject: | Re: simpleXML - simplexml_load_file() timeout? | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-233715@lists.php.net to get a copy of this message | ||
On Mon, 2006-04-10 at 20:52, darren kirby wrote:
> quoth the Richard Lynch:
> > Perhaps, then, you should:
> > maintain a list of URLs and acceptable "age" of feed.
> > Attempt to snag the new content upon visit, if the content is "old"
> > Show the "old" content if the feed takes longer than X seconds.
>
> I really do like this idea, as I would rather use an old feed than just print
> "Feed unavailable" as I have it now.
>
> > You'll STILL need a timeout, which, unfortunately, means you are stuck
> > rolling your own solution with http://php.net/fsockopen
> > because all
> > the "simple" solutions pretty much suck in terms of network timeout.
> >
> > :-(
> >
> > It would be REALLY NIFTY if fopen and friends which understand all
> > those protocols of HTTP FTP HTTPS and so on, allowed one to set a
> > timeout for URLs, but they don't and nobody with the skills to change
> > that (not me) seems even mildly interested. :-( :-( :-(
>
> I am interested, but I don't have the skills either...
>
> > Since I've already written a class that does something like what you
> > want, or maybe even exactly what you want, I might as well just
> > provide the source, eh?
> >
> > http://l-i-e.com/FeedMulti/FeedMulti.phps
>
> Thanks for that, it looks like interesting code, if not a little over my head.
> I am just a duffer here. I will certainly play with it some more. As for
> curl, I realized I didn't add curl support myself, so I am rebuilding PHP
> now...
>
> When I do get something figured out I will post results here. Problem is, with
> either method I need to find a feed that is slow to test with. If I test it
> with a bunk url it will just 404 immediately right? Is there a way to
> simulate a slow connection?
For sure ;) Pull your ethernet cable out. Doesn't get much slower :D
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com
|
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'