Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.4.7

Bug #1074 Set timeout for requests
Submitted: 2004-03-26 09:37 UTC
From: yunosh Assigned: eru
Status: Closed Package: Services_Weather
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    
Subscription  


 [2004-03-26 09:37 UTC] yunosh
Description: ------------ This is more a feature request than a bug. With the current code it is not possible to set a timeout for requests e.g. to xoap.weather.com. Neither XML_Unserializer nor XML_Parser currently support timeouts, because XML_Parser uses fopen() to retrieve the XML data from a web service. But both take also a resource or a string as a parameter, opposed to a file name/url. To implement timeouts you would need to create the socket yourself with fsockopen() and pass the resource handle instead of the original url to XML_Unserializer::unserialize().

Comments

 [2004-03-27 02:51 UTC] eru at php dot net
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on pear.php.net. In case this was a pear.php.net website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better. Fixed by using HTTP_Request in Weatherdotcom.php, specifying timeout parameter at SOAP_WSDL in Ejse.php & Globalweather.php
 [2004-03-28 12:18 UTC] yunosh
Looks good, but the timeout should be configurable. You can keep the 60 secs as a default if no other value is specified.
 [2004-03-28 13:12 UTC] eru at php dot net
Done.