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

Bug #13948 HTTP/Request.php should be require_once'd
Submitted: 2008-05-20 17:56 UTC
From: schmuwi Assigned: hholzgra
Status: Closed Package: HTTP_WebDAV_Client (version CVS)
PHP Version: 5.2.6 OS: MacOS X 10.5.2
Roadmaps: (Not assigned)    

 [2008-05-20 17:56 UTC] schmuwi (Uwe Mesecke)
Description: ------------ In Client/Stream.php there is a require at the top to incude HTTP_Request code. This should better be require_once because if this file was included before in some other script then now the file is included again with all the usual mess: class redeclaration, already defined constants and so on. Test script: --------------- <?php require_once 'HTTP/Request.php'; require_once 'HTTP/WebDAV/Client.php'; ?> Expected result: ---------------- this should not throw any errors Actual result: -------------- ... plenty of notices about already defined constants ... Fatal error: Cannot redeclare class HTTP_Request in /Applications/MAMP/bin/php5/lib/php/HTTP/Request.php on line 122


 [2008-05-23 18:57 UTC] hholzgra (Hartmut Holzgraefe)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on by the end of next Sunday (CET). If this was a problem with the 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.