Re: libxml_set_streams_context

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 17, 2005 9:03 pm, Bill Hoffman said:
> I'm trying to use libxml_set_streams_context() to load a remote xml
> file via HTTP conditional GET with DOMDocument::load() by stuffing an
> 'If-Modified-Since: --- " HTTP header into the stream, but no matter
> how I try it I always get an HTTP 200 response when I know the last-
> modified date is well before my if-modified date string.
>
> I've confirmed via curl -H on the command line that I can do it
> properly and get an HTTP 304 as expected, but I don't know what I'm
> not doing right with libxml_set_streams_context(). Here's my code:
>
> $opts = array('http'=>array('method'=>"GET", 'header'=>"If-Modified-
> Since: Wed, 18 May 2005 23:55:29 GMT\r\n"));
> $context = stream_context_create($opts);
> libxml_set_streams_context($context);
> $doc->load('http://www.somewhere.com/somefile.xml');
> echo $doc->saveXML();

Where is your error checking?

I don't know much about that fancy new stream stuff, or the XML crap, but
you've got zero (0) lines of code in there to do anything useful when the
functions fail.

If you ask the functions nicely, they almost always tell you EXACTLY what
went wrong.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux