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

Request #13876 Make User-Agent header configurable
Submitted: 2008-05-12 10:17 UTC
From: kawai Assigned: hholzgra
Status: Closed Package: HTTP_WebDAV_Client (version 1.0.0)
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    
Subscription  


 [2008-05-12 10:17 UTC] kawai (Hiroaki Kawai)
Description: ------------ I wanted to set User-Agent HTTP header what I like. Submitted patch will use ini_get('HTTP_WebDAV_Client.UserAgent') .

Comments

 [2008-05-14 12:00 UTC] doconnor (Daniel O'Connor)
Looks good at first glance. I will mention that a lot of other pear packages tend towards an $options array of some description in the constructor/factory method, it might be worth a look.
 [2008-05-17 04:38 UTC] kawai (Hiroaki Kawai)
I'm sorry could not find a sample of $options array usage. Can you point one pear package, Daniel? Passing an option is difficult in this HTTP_WebDAV_Client package, because it is just a stream wrapper and we don't make an object directly. ....Ah, stream_context should be used !! I'll create another patch later.
 [2008-05-19 02:51 UTC] kawai (Hiroaki Kawai)
I created a patch. The patch use stream context like this: require_once('HTTP/WebDAV/Client.php'); $c=stream_context_create(array('webdav'=>array('user_agent'=>'MyClient/0.1'))); $fp=file_get_contents('webdav://127.0.0.1/dav/test.txt',false,$c);
 [2008-05-19 04:18 UTC] kawai (Hiroaki Kawai)
I read the PHP manual once again, and changed the patch to meet with the convention of http/https stream wrapper context option. http://www.php.net/manual/en/context.http.php
 [2008-05-23 19:28 UTC] hholzgra (Hartmut Holzgraefe)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.