|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-03-03 20:37 UTC] cataphract@php.net
[2012-03-03 20:37 UTC] cataphract@php.net
-Type: Bug
+Type: Feature/Change Request
[2018-03-11 13:03 UTC] cmb@php.net
-Package: Filesystem function related
+Package: Streams related
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 22:00:01 2025 UTC |
Description: ------------ Currently I'm using a custom Streamwrapper for memcached access. The wrapper works fine unless I'm using the LOCK_EX parameter for file_put_contents. If the parameter is given the function does neither write the file nor calls a method of the streamwrapper. I included simple echo statements in all methods of the streamwapper but no output is shown. I have done this because there is no documentation about which streamwrapper methods are called during file_put_contents. I ASSUME that it should call stream_lock like flock() does - but as mentioned before there is no output at all. Test script: --------------- class MyWrapper { // Assume other methods are implemented // Just for demonstration public function stream_lock($operation) { echo "I've been called"; } } stream_register_wrapper('myWrapper, 'MyWrapper'); $result = file_put_contents('myWrapper://myFile','content',LOCK_EX); echo $result; Expected result: ---------------- true (file is written) Actual result: -------------- false (file is not written)