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

Bug #18457 Stream Wrapper ignores various writing modes
Submitted: 2011-04-19 18:29 UTC
From: davidc Assigned: davidc
Status: Closed Package: Services_Amazon_S3 (version SVN)
PHP Version: 5.3.6 OS: Irrelevant
Roadmaps: (Not assigned)    
Subscription  


 [2011-04-19 18:29 UTC] davidc (David Coallier)
Description: ------------ While testing the Stream Wraper (Services_Amazon_S3_Stream) we've noticed that when using FILE_APPEND with a registered stream, the content would not get appended. After looking at the stream_close override, we've noticed that only the mode 'w' is taken into consideration. Test script: --------------- <?php require_once 'Services/Amazon/S3.php'; require_once 'Services/Amazon/S3/Stream.php'; require_once 'Services/Amazon/S3/AccessControlList.php'; Services_Amazon_S3_Stream::register('s3', array('access_key_id' => 'xxx', 'secret_access_key' => 'yyy', 'acl' => Services_Amazon_S3_AccessControlList::ACL_PUBLIC_READ, ) ); $bucket = 'testing-stream-s3'; $file = 's3://' . $bucket . '/example.txt'; file_put_contents($file, 'one'); file_put_contents($file, 'two', FILE_APPEND); echo file_get_contents($file); Expected result: ---------------- onetwo Actual result: -------------- one

Comments

 [2011-04-19 18:30 UTC] davidc (David Coallier)
 [2011-04-19 19:13 UTC] davidc (David Coallier)
-Status: Open +Status: Closed -Assigned To: +Assigned To: davidc
This bug has been fixed in SVN. 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.